diff --git a/pylops/utils/backend.py b/pylops/utils/backend.py index 31836265..9b7d3b2d 100644 --- a/pylops/utils/backend.py +++ b/pylops/utils/backend.py @@ -17,10 +17,8 @@ "get_sp_fft", "get_complex_dtype", "get_real_dtype", - "to_cupy", "to_numpy", "to_cupy_conditional", - "to_numpy_conditional", "inplace_set", "inplace_add", "inplace_multiply", @@ -486,26 +484,6 @@ def get_real_dtype(dtype: DTypeLike) -> DTypeLike: return np.real(np.ones(1, dtype)).dtype -def to_cupy(x: NDArray) -> NDArray: - """Convert x to cupy array - - Parameters - ---------- - x : :obj:`numpy.ndarray` or :obj:`cupy.ndarray` - Array to evaluate - - Returns - ------- - x : :obj:`numpy.ndarray` - Converted array - - """ - if deps.cupy_enabled: - if cp.get_array_module(x) == np: - x = cp.asarray(x) - return x - - def to_numpy(x: NDArray) -> NDArray: """Convert x to numpy array @@ -549,28 +527,6 @@ def to_cupy_conditional(x: npt.ArrayLike, y: npt.ArrayLike) -> NDArray: return y -def to_numpy_conditional(x: npt.ArrayLike, y: npt.ArrayLike) -> NDArray: - """Convert y to numpy array conditional to x being a numpy array - - Parameters - ---------- - x : :obj:`numpy.ndarray` or :obj:`cupy.ndarray` - Array to evaluate - y : :obj:`numpy.ndarray` - Array to convert - - Returns - ------- - y : :obj:`cupy.ndarray` - Converted array - - """ - if deps.cupy_enabled: - if cp.get_array_module(x) == np and cp.get_array_module(y) == cp: - y = cp.asnumpy(y) - return y - - def inplace_set(x: npt.ArrayLike, y: npt.ArrayLike, idx: list) -> NDArray: """Perform inplace set based on input