Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid numpy sum where we are at risk of overflow #390

Merged
merged 6 commits into from
Sep 8, 2023

Conversation

Wout4
Copy link
Collaborator

@Wout4 Wout4 commented Jul 10, 2023

Numpy is not able to upcast int32 to int64 when overflowing
numpy does not give a warning when overflowing
numpy sum is only faster on numpy arrays not on python lists

  1. change our bound calculations so we don't use numpy arrays, therefor the only things that will still overflow will be things that actually exceed python int bounds

  2. check for overflow

check for overflow in get_bounds
@Wout4 Wout4 linked an issue Jul 10, 2023 that may be closed by this pull request
@Wout4 Wout4 marked this pull request as draft July 10, 2023 15:28
@Wout4 Wout4 marked this pull request as ready for review July 10, 2023 17:31
@Wout4 Wout4 merged commit 0e2e160 into master Sep 8, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dtype problem in flatten model process
1 participant