Skip to content

Commit 0470308

Browse files
committed
ENH: allow copy= in from_dlpack
1 parent 78ec53a commit 0470308

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

array_api_strict/_creation_functions.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,15 +212,12 @@ def from_dlpack(
212212
if copy is not _undef:
213213
raise ValueError("The copy argument to from_dlpack requires at least version 2023.12 of the array API")
214214

215-
# Going to wait for upstream numpy support
216215
if device is not _undef:
217216
_check_device(device)
218217
else:
219218
device = None
220-
if copy not in [_undef, None]:
221-
raise NotImplementedError("The copy argument to from_dlpack is not yet implemented")
222219

223-
return Array._new(np.from_dlpack(x), device=device)
220+
return Array._new(np.from_dlpack(x, copy=copy), device=device)
224221

225222

226223
def full(

0 commit comments

Comments
 (0)