precision issues in unit tests
@@ -33,7 +33,7 @@ class TestMultitaskGaussianLikelihood(BaseLikelihoodTestCase, unittest.TestCase)
# test rank 0 setters
likelihood.noise = 0.5
- self.assertEqual(0.5, likelihood.noise.item())
+ self.assertAlmostEqual(0.5, likelihood.noise.item())
likelihood.task_noises = torch.tensor([0.04, 0.04, 0.04])
for i in range(3):
@@ -42,7 +42,7 @@ class TestMultitaskGaussianLikelihood(BaseLikelihoodTestCase, unittest.TestCase)
# test low rank setters
likelihood = MultitaskGaussianLikelihood(num_tasks=3, rank=2)
likelihood.noise = 0.5
- self.assertEqual(0.5, likelihood.noise.item())
+ self.assertAlmostEqual(0.5, likelihood.noise.item())
a = torch.randn(3, 2)
mat = a.matmul(a.transpose(-1, -2))
