Skip to content

Commit

Permalink
Unify tolerance specification for test_diagonalization()
Browse files Browse the repository at this point in the history
  • Loading branch information
Turakar committed Jan 8, 2024
1 parent a00c08e commit 3b421e6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion linear_operator/test/linear_operator_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ class LinearOperatorTestCase(RectangularLinearOperatorTestCase):
**RectangularLinearOperatorTestCase.tolerances,
"cholesky": {"rtol": 1e-3, "atol": 1e-5},
"diag": {"rtol": 1e-2, "atol": 1e-5},
"diagonalization": {"rtol": 0.05},
"inv_quad": {"rtol": 0.01, "atol": 0.01},
"logdet": {"rtol": 0.2, "atol": 0.03},
"prod": {"rtol": 1e-2, "atol": 1e-2},
Expand Down Expand Up @@ -999,7 +1000,7 @@ def test_diagonalization(self, symeig=False):
approx = evecs.matmul(torch.diag_embed(evals)).matmul(evecs.mT)
res = approx.matmul(test_mat)
actual = linear_op.matmul(test_mat)
self.assertAllClose(res, actual, rtol=0.05)
self.assertAllClose(res, actual, **self.tolerances["diagonalization"])

# Make sure that we're calling the correct function
if not symeig and self.__class__.should_call_lanczos_diagonalization:
Expand Down

0 comments on commit 3b421e6

Please sign in to comment.