Skip to content

Commit 363b479

Browse files
committed
XFAIL Sparse operations
1 parent c7b2edf commit 363b479

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

tests/compile/function/test_pfunc.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import numpy as np
22
import pytest
3+
import scipy as sp
34

45
import pytensor.tensor as pt
56
from pytensor.compile import UnusedInputError, get_mode
@@ -9,6 +10,7 @@
910
from pytensor.compile.sharedvalue import shared
1011
from pytensor.configdefaults import config
1112
from pytensor.graph.utils import MissingInputError
13+
from pytensor.sparse import SparseTensorType
1214
from pytensor.tensor.math import sum as pt_sum
1315
from pytensor.tensor.type import (
1416
bscalar,
@@ -763,18 +765,15 @@ def test_shared_constructor_copies(self):
763765
# rule #2 reading back from pytensor-managed memory
764766
assert not np.may_share_memory(A.get_value(borrow=False), data_of(A))
765767

768+
@pytest.mark.xfail(reason="Numba does not support Sparse Ops yet")
766769
def test_sparse_input_aliasing_affecting_inplace_operations(self):
767-
sp = pytest.importorskip("scipy", minversion="0.7.0")
768-
769-
from pytensor import sparse
770-
771770
# Note: to trigger this bug with pytensor rev 4586:2bc6fc7f218b,
772771
# you need to make in inputs mutable (so that inplace
773772
# operations are used) and to break the elemwise composition
774773
# with some non-elemwise op (here dot)
775774

776-
x = sparse.SparseTensorType("csc", dtype="float64")()
777-
y = sparse.SparseTensorType("csc", dtype="float64")()
775+
x = SparseTensorType("csc", dtype="float64")()
776+
y = SparseTensorType("csc", dtype="float64")()
778777
f = function([In(x, mutable=True), In(y, mutable=True)], (x + y) + (x + y))
779778
# Test 1. If the same variable is given twice
780779

tests/test_raise_op.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ def test_infer_shape_scalar(self):
181181
)
182182

183183

184+
@pytest.mark.xfail(reason="Numba does not support Sparse Ops yet")
184185
def test_CheckAndRaise_sparse_variable():
185186
check_and_raise = CheckAndRaise(ValueError, "sparse_check")
186187

tests/typed_list/test_basic.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ def test_non_tensor_type(self):
452452

453453
assert f([[x, y], [x, y, y]], [x, y]) == 0
454454

455+
@pytest.mark.xfail(reason="Numba does not support Sparse Ops yet")
455456
def test_sparse(self):
456457
mySymbolicSparseList = TypedListType(
457458
sparse.SparseTensorType("csr", pytensor.config.floatX)
@@ -519,6 +520,7 @@ def test_non_tensor_type(self):
519520

520521
assert f([[x, y], [x, y, y]], [x, y]) == 1
521522

523+
@pytest.mark.xfail(reason="Numba does not support Sparse Ops yet")
522524
def test_sparse(self):
523525
mySymbolicSparseList = TypedListType(
524526
sparse.SparseTensorType("csr", pytensor.config.floatX)

0 commit comments

Comments
 (0)