Closed inducer closed 3 months ago
Numpy 1 also seems to mess this up:
import numpy as np
print("numpy", np.__version__)
a = np.array([1, 2, 3], dtype=np.uint32)
print(a - np.int32(7))
print(np.result_type(a, np.int32(7)))
numpy 2.1.1
[-6 -5 -4]
int64
numpy 1.26.4
[4294967290 4294967291 4294967292]
uint32
Example:
currently gives
I believe that this used to be masked before numpy2 by the result being a 32-bit value.