Skip to content

Commit

Permalink
[Cherry-pick for 0.17] Fix TestElastic::test_transform on M1 (#8160)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasHug committed Dec 11, 2023
1 parent 2584baa commit 2b193ec
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/test_transforms_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import pickle
import random
import re
import sys
from copy import deepcopy
from pathlib import Path
from unittest import mock
Expand Down Expand Up @@ -2669,11 +2670,15 @@ def test_displacement_error(self, make_input):
@pytest.mark.parametrize("size", [(163, 163), (72, 333), (313, 95)])
@pytest.mark.parametrize("device", cpu_and_cuda())
def test_transform(self, make_input, size, device):
# We have to skip that test on M1 because it's flaky: Mismatched elements: 35 / 89205 (0.0%)
# See https://github.com/pytorch/vision/issues/8154
# All other platforms are fine, so the differences do not come from something we own in torchvision
check_v1_compatibility = False if sys.platform == "darwin" else dict(rtol=0, atol=1)

check_transform(
transforms.ElasticTransform(),
make_input(size, device=device),
# We updated gaussian blur kernel generation with a faster and numerically more stable version
check_v1_compatibility=dict(rtol=0, atol=1),
check_v1_compatibility=check_v1_compatibility,
)


Expand Down

0 comments on commit 2b193ec

Please sign in to comment.