Skip to content

Commit 0acbf80

Browse files
malfetpytorchmergebot
authored andcommitted
[BE] Unskip some tensor creation tests on Mac (pytorch#146952)
Followup after pytorch#145367 One should never use skip, but rather xfail otherwise one never knows when test is finally fixed. `test_float_to_int_conversion_finite` were fixed on MacOS a while back (guess since the time Intel builds were disbaled), while `test_float_to_int_conversion_nonfinite` is fixed by pytorch#145367 that selects architecture-appropriate reference values for Arm ISA Note, that results of floating to integral types cast are undefined if floating point value is outside of integral dynamic range "Fixes" pytorch#38752 Pull Request resolved: pytorch#146952 Approved by: https://github.com/atalman, https://github.com/seemethere
1 parent 78ebd3c commit 0acbf80

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

test/test_tensor_creation_ops.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@
2626
set_default_dtype,
2727
set_default_tensor_type,
2828
TEST_SCIPY,
29-
IS_MACOS,
3029
IS_PPC,
31-
IS_JETSON,
3230
IS_WINDOWS,
3331
IS_FBCODE,
3432
IS_SANDCASTLE,
@@ -1051,8 +1049,6 @@ def _float_to_int_conversion_helper(self, vals, device, dtype, refs=None):
10511049
# errors with UBSAN. These casts are deliberate in PyTorch, however, and
10521050
# NumPy may have the same behavior.
10531051
@onlyNativeDeviceTypes
1054-
@unittest.skipIf(IS_MACOS or IS_JETSON, "Test is broken on MacOS and Jetson, \
1055-
see https://github.com/pytorch/pytorch/issues/38752")
10561052
@unittest.skipIf(IS_PPC, "Test is broken on PowerPC, see https://github.com/pytorch/pytorch/issues/39671")
10571053
@dtypes(torch.bool, torch.uint8, torch.int8, torch.int16, torch.int32, torch.int64)
10581054
def test_float_to_int_conversion_finite(self, device, dtype):
@@ -1081,10 +1077,10 @@ def test_float_to_int_conversion_finite(self, device, dtype):
10811077
self._float_to_int_conversion_helper(vals, device, dtype, refs)
10821078

10831079
# Note: CUDA will fail this test on most dtypes, often dramatically.
1080+
# Note: This test validates undefined behavior consistency in float-to-ints casts
10841081
# NB: torch.uint16, torch.uint32, torch.uint64 excluded as this
10851082
# nondeterministically fails, warning "invalid value encountered in cast"
10861083
@onlyCPU
1087-
@unittest.skipIf(IS_MACOS, "Nonfinite conversion results on MacOS are different from others.")
10881084
@unittest.skipIf(IS_S390X, "Test fails for int16 on s390x. Needs investigation.")
10891085
@dtypes(torch.bool, torch.uint8, torch.int8, torch.int16, torch.int32, torch.int64)
10901086
def test_float_to_int_conversion_nonfinite(self, device, dtype):

0 commit comments

Comments
 (0)