Skip to content

Commit

Permalink
Loosen tolerance for double precision
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinfriede committed Jul 25, 2023
1 parent 698bc86 commit 2da4da0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_utils/test_cdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

@pytest.mark.parametrize("dtype", [torch.float32, torch.float64])
def test_all(dtype: torch.dtype) -> None:
tol = torch.finfo(dtype).eps * 10
tol = 1e-6 if dtype == torch.float else 1e-14

x = torch.randn(2, 3, 4, dtype=dtype)

Expand All @@ -40,7 +40,7 @@ def test_all(dtype: torch.dtype) -> None:
@pytest.mark.parametrize("dtype", [torch.float32, torch.float64])
@pytest.mark.parametrize("p", [2, 3, 4, 5])
def test_ps(dtype: torch.dtype, p: int) -> None:
tol = torch.finfo(dtype).eps * 10
tol = 1e-6 if dtype == torch.float else 1e-14

x = torch.randn(2, 4, 5, dtype=dtype)
y = torch.randn(2, 4, 5, dtype=dtype)
Expand Down

0 comments on commit 2da4da0

Please sign in to comment.