From ad710a3d80390c1d7aa50f56dca226c803b41b37 Mon Sep 17 00:00:00 2001 From: Hameer Abbasi <2190658+hameerabbasi@users.noreply.github.com> Date: Mon, 9 Dec 2024 06:59:17 +0100 Subject: [PATCH] Remove workaround introduced in #822. --- pixi.toml | 2 +- sparse/mlir_backend/_conversions.py | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/pixi.toml b/pixi.toml index 5f209a55..98cfb43c 100644 --- a/pixi.toml +++ b/pixi.toml @@ -48,7 +48,7 @@ matrepr = "*" precompile = "python -c 'import finch'" [feature.finch.pypi-dependencies] -scipy = ">=0.19" +scipy = ">=1.13" finch-tensor = ">=0.2.1" [feature.finch.activation.env] diff --git a/sparse/mlir_backend/_conversions.py b/sparse/mlir_backend/_conversions.py index e66eb408..9d114436 100644 --- a/sparse/mlir_backend/_conversions.py +++ b/sparse/mlir_backend/_conversions.py @@ -78,8 +78,6 @@ def _from_scipy(arr: ScipySparseArray, copy: bool | None = None) -> Array: return from_constituent_arrays(format=csx_format, arrays=(indptr, indices, data), shape=arr.shape) case "coo": - from ._common import _hold_ref - row, col = arr.row, arr.col if row.dtype != col.dtype: raise RuntimeError(f"`row` and `col` dtypes must be the same: {row.dtype} != {col.dtype}.") @@ -101,10 +99,7 @@ def _from_scipy(arr: ScipySparseArray, copy: bool | None = None) -> Array: .build() ) - ret = from_constituent_arrays(format=coo_format, arrays=(pos, row, col, data), shape=arr.shape) - if not copy: - _hold_ref(ret, arr) - return ret + return from_constituent_arrays(format=coo_format, arrays=(pos, row, col, data), shape=arr.shape) case _: raise NotImplementedError(f"No conversion implemented for `scipy.sparse.{type(arr.__name__)}`.")