Skip to content

Commit ac8d215

Browse files
Round gaussian_blur outputs before OpenCV reference compare. (#9579)
Co-authored-by: Nicolas Hug <nh.nicolas.hug@gmail.com>
1 parent 9e21b88 commit ac8d215

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

test/test_functional_tensor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,8 @@ 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+
# OpenCV references are uint8; round float outputs before comparing levels.
1057+
torch.testing.assert_close(torch.round(out), true_out, rtol=0.0, atol=1.0, msg=f"{ksize}, {sigma}")
10571058

10581059

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

0 commit comments

Comments
 (0)