Skip to content

Commit 60997e0

Browse files
committed
bug: fixes #579
1 parent 42c6b2f commit 60997e0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pylops/utils/backend.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,5 +437,6 @@ def to_cupy_conditional(x: npt.ArrayLike, y: npt.ArrayLike) -> NDArray:
437437
"""
438438
if deps.cupy_enabled:
439439
if cp.get_array_module(x) == cp and cp.get_array_module(y) == np:
440-
y = cp.asarray(y)
440+
with cp.cuda.Device(x.device):
441+
y = cp.asarray(y)
441442
return y

0 commit comments

Comments
 (0)