Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The max_version argument to __dlpack__ is not yet implemented #85

Closed
njzjz opened this issue Nov 7, 2024 · 1 comment · Fixed by #86
Closed

The max_version argument to __dlpack__ is not yet implemented #85

njzjz opened this issue Nov 7, 2024 · 1 comment · Fixed by #86

Comments

@njzjz
Copy link

njzjz commented Nov 7, 2024

I see that __array__ is removed in the latest version, and from_dlpack is suggested. But when I use it, I found that from_dlpack throws the following error:

>>> import numpy as np
>>> import array_api_strict
>>> np.from_dlpack(array_api_strict.asarray(0))
(1, 0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jz748/anaconda3/lib/python3.10/site-packages/array_api_strict/_array_object.py", line 592, in __dlpack__
    raise NotImplementedError("The max_version argument to __dlpack__ is not yet implemented")
NotImplementedError: The max_version argument to __dlpack__ is not yet implemented

version: numpy 2.1.3 array_api_strict 2.1.1

So, there is no way to convert an array_api_strict array to numpy?

@asmeurer
Copy link
Member

asmeurer commented Nov 7, 2024

Ah I had missed that that was implemented upstream and wasn't fixed yet here. #86

We really should just require the latest version of NumPy #21.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants