We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e92d063 + 7bae3b7 commit 4c6b360Copy full SHA for 4c6b360
1 file changed
array_api_strict/_creation_functions.py
@@ -212,15 +212,15 @@ def from_dlpack(
212
if copy is not _undef:
213
raise ValueError("The copy argument to from_dlpack requires at least version 2023.12 of the array API")
214
215
- # Going to wait for upstream numpy support
216
if device is not _undef:
217
_check_device(device)
218
else:
219
device = None
220
- if copy not in [_undef, None]:
221
- raise NotImplementedError("The copy argument to from_dlpack is not yet implemented")
+ if copy in [_undef, None]:
+ # numpy 1.26 does not have the copy= arg
+ return Array._new(np.from_dlpack(x), device=device)
222
223
- return Array._new(np.from_dlpack(x), device=device)
+ return Array._new(np.from_dlpack(x, copy=copy), device=device)
224
225
226
def full(
0 commit comments