Skip to content

Commit 37e5bf8

Browse files
authored
Merge pull request #425 from aarmey/fix-mxnet
Fix mxnet testing
2 parents 90a3463 + cbdcfdb commit 37e5bf8

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

‎.github/workflows/test.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
elif [[ "${{matrix.BACKEND}}" == "mxnet" ]]; then
3737
echo "Installing MXNet";
3838
sudo apt install gfortran;
39-
pip install mxnet<3 --pre -f https://dist.mxnet.io/python;
39+
pip install mxnet;
4040
elif [[ "${{matrix.BACKEND}}" == "jax" ]]; then
4141
echo "Installing JAX";
4242
pip install jax jaxlib;

‎tensorly/decomposition/robust_decomposition.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def robust_pca(
131131

132132
# Convergence check
133133
if iteration > 1:
134-
if max(rec_X[-1], rec_D[-1]) <= tol:
134+
if rec_X[-1] <= tol and rec_D[-1] <= tol:
135135
if verbose:
136136
print("\nConverged in {} iterations".format(iteration))
137137
break

‎tensorly/tests/test_tt_tensor.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
import pytest
1010

1111

12+
skip_mxnet = pytest.mark.skipif(
13+
tl.get_backend() == "mxnet",
14+
reason="MXNet currently does not support transpose for tensors of order > 6.",
15+
)
16+
17+
1218
def test_validate_tt_tensor():
1319
rng = tl.check_random_state(12345)
1420
true_shape = (3, 4, 5)
@@ -150,6 +156,7 @@ def test_validate_tt_rank():
150156
assert_(n_param >= n_param_tensor * coef)
151157

152158

159+
@skip_mxnet
153160
@pytest.mark.parametrize("n_pad", [1, 2])
154161
def test_pad_tt_rank(n_pad):
155162
"""Test for pad_tt_rank"""

0 commit comments

Comments
 (0)