From bbd91ebbdac996515640c2311800cb38b2720e42 Mon Sep 17 00:00:00 2001 From: Yipeng Li Date: Sat, 20 Aug 2022 12:00:41 +0800 Subject: [PATCH] Add relative threshold while testing inversing --- python/oneflow/test/modules/test_inv.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/oneflow/test/modules/test_inv.py b/python/oneflow/test/modules/test_inv.py index ce31b3c3b38..854741b90a0 100644 --- a/python/oneflow/test/modules/test_inv.py +++ b/python/oneflow/test/modules/test_inv.py @@ -23,19 +23,19 @@ @flow.unittest.skip_unless_1n1d() class TestLinalgInv(flow.unittest.TestCase): - @autotest(n=5) + @autotest(n=5, rtol=1e-2) def test_inv_3by3_with_random_data(test_case): device = random_device() x = random_tensor(ndim=2, dim0=3, dim1=3, low=-1).to(device) return torch.linalg.inv(x) - @autotest(n=5) + @autotest(n=5, rtol=1e-2) def test_inv_batch_3by3_with_random_data(test_case): device = random_device() x = random_tensor(ndim=3, dim0=random(), dim1=3, dim2=3, low=-1).to(device) return torch.linalg.inv(x) - @autotest(n=5, rtol=1e-3, atol=1e-3) + @autotest(n=5, rtol=1e-2) def test_inv_random_square_with_random_data(test_case): device = random_device() square_dim = random()