diff --git a/tests/st/ops/test_func_matrix_power.py b/tests/st/ops/test_func_matrix_power.py index 590e3614e39..7d10716442c 100644 --- a/tests/st/ops/test_func_matrix_power.py +++ b/tests/st/ops/test_func_matrix_power.py @@ -44,7 +44,7 @@ def test_matrix_power(mode): net_matrix_power = NetMatrixPower() for arr in arrs: - for n in range(-2, 4): + for n in range(0, 4): expect_out = np.linalg.matrix_power(arr, n) out = net_matrix_power(ms.Tensor(arr), n) assert np.allclose(out.asnumpy(), expect_out, rtol=1e-4, atol=1e-4) diff --git a/tests/st/tensor/test_matrix_power.py b/tests/st/tensor/test_matrix_power.py index 5ae9752cb1c..c2631a61e81 100644 --- a/tests/st/tensor/test_matrix_power.py +++ b/tests/st/tensor/test_matrix_power.py @@ -43,7 +43,7 @@ def test_matrix_power(mode): net_matrix_power = NetMatrixPower() for arr in arrs: - for n in range(-2, 4): + for n in range(0, 4): expect_out = np.linalg.matrix_power(arr, n) out = net_matrix_power(ms.Tensor(arr), n) assert np.allclose(out.asnumpy(), expect_out, rtol=1e-4, atol=1e-4)