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
Can't take max of arrays at least as large as 2 ** 32 #495
Comments
Are you on 32-bit Windows by any chance? |
I'm on 64-bit Windows. I just checked and this bug is not present on Manjaro 21.0.7 with Linux 5.12.9-1-MANJARO (x86_64). |
Mentoring instructions: Replace all uses of |
Hello, I ran into the same problem. Was there any solution to this? |
A quick update since I'm now digging into the library. I see that there is an The result is, effectively, that A proposal for improving this would be:
I don't know which, if any, parameter combinations should be forbidden to ensure there is no infinite recursion in the constructor, but I believe someone with more knowledge of the codebase might know what and where to check so this doesn't happen. |
I traced the issue to its source and came up with a hack to make this work, should anyone else also run into this problem. My hack to solve this is to hardcode
This solves the problem when calling |
Thanks @GPhilo for digging into this, I'll try to set some time aside this weekend to fix it and cut a release. |
It has been more than 2 years and this issue seems still exists. Any update on this? |
This doesn't happen anymore on |
Describe the bug
Calling
sparse.COO.max
on an array larger than 2 ** 32 - 1 fails aTypeError
like so:To Reproduce
Create an array
a
at least as large as 2 ** 32 with at least one nonzero element, then calla.max()
. For example:Expected behavior
Return the maximum value of the array (1 in the example above).
System
sparse
version: 0.12.0+44.g765e297 (bug is also present in 0.12.0, installed from pip)Additional context
sparse.COO.max
works on an array of size 2 ** 32 if it is empty (i.e.a.nnz == 0
).The text was updated successfully, but these errors were encountered: