Skip to content

Commit ea4a372

Browse files
committed
Remove unused import, use torch mode
1 parent 4f475c8 commit ea4a372

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pytensor/link/pytorch/dispatch/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import pytensor.link.pytorch.dispatch.shape
1212
import pytensor.link.pytorch.dispatch.sort
1313
import pytensor.link.pytorch.dispatch.subtensor
14-
import pytensor.link.pytorch.dispatch.nlinalg
1514
import pytensor.link.pytorch.dispatch.slinalg
1615
import pytensor.link.pytorch.dispatch.blockwise
1716
# isort: on

tests/link/pytorch/test_slinalg.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
from pytensor.tensor.slinalg import cholesky
77

88

9+
torch = pytest.importorskip("torch")
10+
11+
912
@pytest.mark.parametrize(
1013
"cov_batch_shape", [(), (1000,), (4, 1000)], ids=lambda arg: f"cov:{arg}"
1114
)
@@ -19,4 +22,6 @@ def test_batched_mvnormal_logp_and_dlogp(cov_batch_shape):
1922
chol_cov = cholesky(cov, lower=True, on_error="raise")
2023

2124
fn = pytensor.function([cov], [chol_cov])
22-
assert np.all(np.isclose(fn(test_values), np.linalg.cholesky(test_values)))
25+
assert np.all(
26+
np.isclose(fn(test_values, mode="PYTORCH"), np.linalg.cholesky(test_values))
27+
)

0 commit comments

Comments
 (0)