Skip to content

Commit

Permalink
fix atol in resize_image kernel test (#8133)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmeier authored Nov 23, 2023
1 parent ec7f80b commit 1fda0e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/test_transforms_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 1fda0e8

Please sign in to comment.