Open
Description
Dear all,
I run the following command when xp is cupy
# cupy
x = cupy.asarray([1.0] * 3)
xp = array_api_compat.array_namespace(x)
E = xp.eye(3, 3, k=0, dtype='float64', device=1)
print(E.device)
with xp.cuda.Device(1):
E = xp.eye(3, 3, k=0, dtype='float64', device=1)
print(E.device)
# torch
x = torch.as_tensor([1.0] * 3)
xp = array_api_compat.array_namespace(x)
E = xp.eye(3, 3, k=0, dtype=torch.float64, device='cuda:1')
print(E.device)
and I get the result:
<CUDA Device 0>
<CUDA Device 1>
cuda:1
It seems that device argument of xp.eye has no effect here when xp is cupy.
It seems to work well when xp is torch.
Did I miss something?
Thank you.
array-api-compat 1.12.0
cupy-cuda12x 13.4.1