Skip to content

Commit 992c2cb

Browse files
authored
Merge pull request #661 from mrava87/bug-get_module_name
bug: added safeguards to get_module_name
2 parents d62f4f4 + ce89a2d commit 992c2cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pylops/utils/backend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ def get_module_name(mod: ModuleType) -> str:
114114
"""
115115
if mod == np:
116116
backend = "numpy"
117-
elif mod == cp:
117+
elif deps.cupy_enabled and mod == cp:
118118
backend = "cupy"
119-
elif mod == jnp:
119+
elif deps.jax_enabled and mod == jnp:
120120
backend = "jax"
121121
else:
122122
raise ValueError("module must be numpy, cupy, or jax")

0 commit comments

Comments
 (0)