Skip to content

Commit

Permalink
bug: fixes PyLops#579
Browse files Browse the repository at this point in the history
  • Loading branch information
mrava87 committed May 22, 2024
1 parent 42c6b2f commit 60997e0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pylops/utils/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,5 +437,6 @@ def to_cupy_conditional(x: npt.ArrayLike, y: npt.ArrayLike) -> NDArray:
"""
if deps.cupy_enabled:
if cp.get_array_module(x) == cp and cp.get_array_module(y) == np:
y = cp.asarray(y)
with cp.cuda.Device(x.device):
y = cp.asarray(y)
return y

0 comments on commit 60997e0

Please sign in to comment.