Skip to content

Commit

Permalink
[fbsync] fix atol in resize_image kernel test (#8133)
Browse files Browse the repository at this point in the history
Reviewed By: vmoens

Differential Revision: D52539020

fbshipit-source-id: eb831a95f2ccc86521b5b5af8fa5ad1c6e484ea2
  • Loading branch information
NicolasHug authored and facebook-github-bot committed Jan 16, 2024
1 parent 9bebcc8 commit fe72eb7
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 fe72eb7

Please sign in to comment.