Universal function at
indices
must have fewer than 2**31 elements or else they are ignored
#13286
Labels
at
indices
must have fewer than 2**31 elements or else they are ignored
#13286
When running an accumulator (for example with
np.add.at
) then the length of theindices
must be fewer than 2**32 elements. Otherwise, the accumulator only uses the firstnp.int32(indices.size)
elements in the accumulator. This fails on all numpys up to and including 1.16.2.Reproducing code example:
Note that the following code needs to be run on a computer with a lot of memory, >~ 64Gb.
This code does not work. Expectation is that
inds.size
is the same asaccum.sum()
, which is not true. You might notice thataccum
is mostly 0s.The following code does work, and seems to be the largest size that does:
Error message:
There is no error logged from numpy , the answer is simply wrong. In the test code:
Numpy/Python version information:
1.16.2 3.7.2 (default, Dec 29 2018, 06:19:36)
[GCC 7.3.0]
The text was updated successfully, but these errors were encountered: