Skip to content

Commit 772d781

Browse files
committed
Relax tolerance for test_gaussian_blur
1 parent e3b5d3a commit 772d781

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/test_functional_tensor.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,14 @@ def test_gaussian_blur(device, image_size, dt, ksize, sigma, fn):
10531053
)
10541054

10551055
out = fn(tensor, kernel_size=ksize, sigma=sigma)
1056-
torch.testing.assert_close(out, true_out, rtol=0.0, atol=1.0, msg=f"{ksize}, {sigma}")
1056+
1057+
if torch.version.hip:
1058+
gcn_arch = str(torch.cuda.get_device_properties(0).gcnArchName.split(":", 1)[0])
1059+
atol = 1.2 if "gfx90a" in gcn_arch else 1.0
1060+
else:
1061+
atol = 1.0
1062+
1063+
torch.testing.assert_close(out, true_out, rtol=0.0, atol=atol, msg=f"{ksize}, {sigma}")
10571064

10581065

10591066
@pytest.mark.parametrize("device", cpu_and_cuda())

0 commit comments

Comments
 (0)