Skip to content

Commit feae86b

Browse files
committed
Fix asarray
1 parent aca16d6 commit feae86b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

array_api_compat/cupy/_aliases.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ def asarray(
8787
if copy is False:
8888
raise NotImplementedError("asarray(copy=False) is not yet supported in cupy")
8989

90-
with _helpers._device_ctx(cp, device):
90+
like = obj if _helpers.is_cupy_array(obj) else None
91+
with _helpers._device_ctx(cp, device, like=like):
9192
if copy is None:
9293
return cp.asarray(obj, dtype=dtype, **kwargs)
9394
else:

0 commit comments

Comments
 (0)