Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add relative threshold while testing inversing #8973

Merged
merged 1 commit into from
Aug 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions python/oneflow/test/modules/test_inv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down