BUG: cp.generic is an alias for np.generic#207
Conversation
2267e0e to
5b2b3b4
Compare
|
This PR is ready to be reviewed and merged.
|
|
What would be a scenario where cupy aliasing array scalars matters? I just tried running https://github.com/data-apis/array-api-compat/blob/main/test_cupy.sh locally, and it passes with or without. |
Not that I'm aware of. To me this looks like a copy-paste error from |
|
So if there's no use case, what are the reasons for this then? |
5b2b3b4 to
8b53a7e
Compare
There is no use case that I know of where |
|
This is ready for final review and merge. |
That's bad indeed if that happens, but... does it? This is on main, after What am I missing? |
You're missing cupy in In [1]: from array_api_compat import is_cupy_array
In [2]: import numpy as np
In [3]: g = np.asarray([0])[0]
In [4]: is_cupy_array(g)
Out[4]: False
In [5]: import cupy
In [6]: is_cupy_array(g)
Out[6]: True |
ev-br
left a comment
There was a problem hiding this comment.
Ouf, yes indeed, is_cupy_array(....) is False unless cupy has been imported. So yes, a clear bug with a clear fix. Thank you @crusaderky
Fix bug where plain numpy objects e.g. np.int64(0) would take cupy-specific code paths.
This is a blocker for implementing
atfunction in array-api-extra.