Uh oh!
There was an error while loading. Please reload this page.
BUG: cp.generic is an alias for np.generic - #207
Conversation
2267e0e to
5b2b3b4CompareThis PR is ready to be reviewed and merged.
|
ev-br
commented
Dec 2, 2024
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. |
crusaderky
commented
Dec 2, 2024
Not that I'm aware of. To me this looks like a copy-paste error from |
ev-br
commented
Dec 12, 2024
So if there's no use case, what are the reasons for this then? |
5b2b3b4 to
8b53a7eComparecrusaderky
commented
Dec 12, 2024
There is no use case that I know of where |
This is ready for final review and merge. |
ev-br
commented
Dec 12, 2024
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]: fromarray_api_compatimportis_cupy_arrayIn [2]: importnumpyasnpIn [3]: g=np.asarray([0])[0]
In [4]: is_cupy_array(g)
Out[4]: FalseIn [5]: importcupyIn [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.