From d2fa7b5aec8224b1c3f938fd06b465b9d2476d2b Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Thu, 23 Nov 2023 16:34:26 +0100 Subject: [PATCH] fix atol in resize_image kernel test --- test/test_transforms_v2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_transforms_v2.py b/test/test_transforms_v2.py index 4f8d0027bd6..0123d822238 100644 --- a/test/test_transforms_v2.py +++ b/test/test_transforms_v2.py @@ -599,7 +599,7 @@ def test_kernel_image(self, size, interpolation, use_max_size, antialias, dtype, # In contrast to CPU, there is no native `InterpolationMode.BICUBIC` implementation for uint8 images on CUDA. # Internally, it uses the float path. Thus, we need to test with an enormous tolerance here to account for that. - atol = 30 if transforms.InterpolationMode.BICUBIC and dtype is torch.uint8 else 1 + atol = 30 if (interpolation is transforms.InterpolationMode.BICUBIC and dtype is torch.uint8) else 1 check_cuda_vs_cpu_tolerances = dict(rtol=0, atol=atol / 255 if dtype.is_floating_point else atol) check_kernel(