Closed
Description
This is related to the issue #13734
but in this example it is not a difference in term of the 7th significant number, the value returned by the sum is unusable and I think an error should be raised or the result should be +inf
Reproducing code example:
import numpy as np
a = np.ones((3, 2000, 115), dtype=np.float16)
x = a[0].sum(0)[110]
y = a[0, :, 110].sum(0)
print(x)
# 2000.0
print(y)
# 2000.0
#########
a = np.ones((3, 3000, 115), dtype=np.float16)
x = a[0].sum(0)[110]
y = a[0, :, 110].sum(0)
print(x)
# 2048.0
print(y)
# 3000.0
#########
a = np.ones((3, 6000, 115), dtype=np.float16)
x = a[0].sum(0)[110]
y = a[0, :, 110].sum(0)
print(x)
# 2048.0
print(y)
# 6000.0
Numpy/Python version information:
numpy version : 1.18.2
python version : 3.8.1
Metadata
Metadata
Assignees
Labels
No labels