Skip to content

Commit 9fba411

Browse files
Relax tolerance on linalg tests in float32 mode
1 parent c61bf79 commit 9fba411

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/tensor/test_slinalg.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
from tests import unittest_tools as utt
3333

3434

35+
ATOL = 1e-8 if config.floatX.endswith("64") else 1e-4
36+
RTOL = 1e-8 if config.floatX.endswith("64") else 1e-4
37+
38+
3539
def check_lower_triangular(pd, ch_f):
3640
ch = ch_f(pd)
3741
assert ch[0, pd.shape[1] - 1] == 0
@@ -265,6 +269,8 @@ def A_func(x):
265269
np.testing.assert_allclose(
266270
scipy.linalg.solve(solve_input_val, b_val, assume_a=assume_a),
267271
X_np,
272+
atol=ATOL,
273+
rtol=RTOL,
268274
)
269275

270276
np.testing.assert_allclose(A_func(A_val) @ X_np, b_val, atol=1e-6)

0 commit comments

Comments
 (0)