Skip to content

Commit ea1da5d

Browse files
committed
Remove global RTOl and ATOL in test file
1 parent 2aecb95 commit ea1da5d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

tests/tensor/rewriting/test_linalg.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@
4242
from tests.test_rop import break_op
4343

4444

45-
ATOL = RTOL = 1e-3 if config.floatX == "float32" else 1e-8
46-
47-
4845
def test_rop_lop():
4946
mx = matrix("mx")
5047
mv = matrix("mv")
@@ -630,11 +627,12 @@ def test_inv_diag_from_eye_mul(shape, inv_op):
630627
inverse_matrix = np.linalg.inv(x_test_matrix)
631628
rewritten_inverse = f_rewritten(x_test)
632629

630+
atol = rtol = 1e-3 if config.floatX == "float32" else 1e-8
633631
assert_allclose(
634632
inverse_matrix,
635633
rewritten_inverse,
636-
atol=ATOL,
637-
rtol=RTOL,
634+
atol=atol,
635+
rtol=rtol,
638636
)
639637

640638

@@ -657,11 +655,12 @@ def test_inv_diag_from_diag(inv_op):
657655
inverse_matrix = np.linalg.inv(x_test_matrix)
658656
rewritten_inverse = f_rewritten(x_test)
659657

658+
atol = rtol = 1e-3 if config.floatX == "float32" else 1e-8
660659
assert_allclose(
661660
inverse_matrix,
662661
rewritten_inverse,
663-
atol=ATOL,
664-
rtol=RTOL,
662+
atol=atol,
663+
rtol=rtol,
665664
)
666665

667666

0 commit comments

Comments
 (0)