From 1fda0e850a2ff5dca7f10a2e12286c87645d6760 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Thu, 23 Nov 2023 19:59:42 +0100 Subject: [PATCH] fix atol in resize_image kernel test (#8133) --- 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 3496f637b38..6539ae62079 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(