Unverified Commit 99a999c0 authored by Nicolas Hug's avatar Nicolas Hug Committed by GitHub
Browse files

Fix TestElastic::test_transform on M1 (#8155)

parent e12d200c
...@@ -7,6 +7,7 @@ import math ...@@ -7,6 +7,7 @@ import math
import pickle import pickle
import random import random
import re import re
import sys
from copy import deepcopy from copy import deepcopy
from pathlib import Path from pathlib import Path
from unittest import mock from unittest import mock
...@@ -2669,11 +2670,15 @@ class TestElastic: ...@@ -2669,11 +2670,15 @@ class TestElastic:
@pytest.mark.parametrize("size", [(163, 163), (72, 333), (313, 95)]) @pytest.mark.parametrize("size", [(163, 163), (72, 333), (313, 95)])
@pytest.mark.parametrize("device", cpu_and_cuda()) @pytest.mark.parametrize("device", cpu_and_cuda())
def test_transform(self, make_input, size, device): 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( check_transform(
transforms.ElasticTransform(), transforms.ElasticTransform(),
make_input(size, device=device), make_input(size, device=device),
# We updated gaussian blur kernel generation with a faster and numerically more stable version check_v1_compatibility=check_v1_compatibility,
check_v1_compatibility=dict(rtol=0, atol=1),
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment