Skip to content

Commit

Permalink
Address review comments by @mtsokol.
Browse files Browse the repository at this point in the history
  • Loading branch information
hameerabbasi committed Nov 12, 2024
1 parent 0577a73 commit 1855c77
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions sparse/mlir_backend/_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ def add(x1: Array, x2: Array, /) -> Array:


def asformat(x: Array, /, format: StorageFormat) -> Array:
if x.format == format:
return x

out_tensor_type = format._get_mlir_type(shape=x.shape)
ret_storage = format._get_ctypes_type(owns_memory=True)()

Expand Down
9 changes: 6 additions & 3 deletions sparse/mlir_backend/tests/test_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,12 @@ def test_reshape_dense(dtype):
np.testing.assert_equal(actual_np, expected)


@pytest.mark.skip(reason="Segfault")
@pytest.mark.parametrize("src_fmt", ["csr", "csc"])
@pytest.mark.parametrize("dst_fmt", ["csr", "csc"])
@pytest.mark.parametrize(
"src_fmt", ["csr", "csc", pytest.param("coo", marks=pytest.mark.skip(reason="TODO: Report MLIR issue"))]
)
@pytest.mark.parametrize(
"dst_fmt", ["csr", "csc", pytest.param("coo", marks=pytest.mark.skip(reason="TODO: Report MLIR issue"))]
)
def test_asformat(rng, src_fmt, dst_fmt):
SHAPE = (100, 50)
DENSITY = 0.5
Expand Down

0 comments on commit 1855c77

Please sign in to comment.