File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -212,15 +212,15 @@ 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" )
219+ if copy in [_undef , None ]:
220+ # numpy 1.26 does not have the copy= arg
221+ return Array ._new (np .from_dlpack (x ), device = device )
222222
223- return Array ._new (np .from_dlpack (x ), device = device )
223+ return Array ._new (np .from_dlpack (x , copy = copy ), device = device )
224224
225225
226226def full (
You can’t perform that action at this time.
0 commit comments