Skip to content

Commit

Permalink
Merge pull request #580 from mrava87/bug-to_cupy_cond
Browse files Browse the repository at this point in the history
bug: to_cupy_conditional
  • Loading branch information
mrava87 authored May 22, 2024
2 parents 23c5539 + 60997e0 commit 27636e5
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 @@ -461,5 +461,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 27636e5

Please sign in to comment.