You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ran into this via an esoteric route: When tinkering with user-defined dtypes, it seems that implementation of np.ones uses np.copyto(dst, 1, casting='unsafe'), where the 1 gets interpreted as np.array(1, dtype=np.int64) (at least, on my platform).
When I tried registered a caster using npy_descriptor_format<int64_t>::dtype() using the type_num field, I realized its value was for NPY_LONGLONG, whereas NPY_INT64 corresponds to NPY_LONG.
Will try to see if I can create a failing test, and then submit a tentative fix PR based on that.
The text was updated successfully, but these errors were encountered:
Ran into this via an esoteric route: When tinkering with user-defined dtypes, it seems that implementation of
np.ones
usesnp.copyto(dst, 1, casting='unsafe')
, where the1
gets interpreted asnp.array(1, dtype=np.int64)
(at least, on my platform).When I tried registered a caster using
npy_descriptor_format<int64_t>::dtype()
using thetype_num
field, I realized its value was forNPY_LONGLONG
, whereasNPY_INT64
corresponds toNPY_LONG
.Will try to see if I can create a failing test, and then submit a tentative fix PR based on that.
The text was updated successfully, but these errors were encountered: