-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Bug in ravel_multi_index for big indexes #7546
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
Comments
Hmm... I think this should not be too difficult to fix. |
There's an |
Still broken as of july 10, 2016. |
Fix bug in ravel_multi_index for big indices (Issue #7546)
This issue seems to have been fixed in #8109 and can be closed now. |
Thanks |
I'm working with big sparse multidimensional arrays using scipy and numpy and I've found a bug in numpy.ravel_multi_index. Specifically, for big index values (greater than 2^32) sometimes the returned value is invalid or even negative (it should be always nonnegative using the default ‘raise’ mode). Probably due to casting integers to int32 in ravel_multi_index.
Sample code that reproduces the problem:
OK
Invalid result, should be [5627771580]
Invalid result, should be [117259570957]
I know that in such a case the maximum index value is huge (1,6104E+11), but not that huge.. I get the same error even when explicitly specifying all integers as numpy.int64. Setting modes {‘raise’, ‘wrap’, ‘clip’} does not have any effect either.
Tested using numpy
1.9.2
(Python 3.4.3 64bit) on Windows, and numpy1.11.0
(Python 3.4.3 64bit) on Ubuntu.The text was updated successfully, but these errors were encountered: