pytorch
e7a5cb99 - [CI] Fix test failures at TestTensorCreationCPU.test_float_to_int_conversion_finite_cpu_uint8 (#98916)

Commit
1 year ago
[CI] Fix test failures at TestTensorCreationCPU.test_float_to_int_conversion_finite_cpu_uint8 (#98916) This PR fixes divergent value issues in converting float32 to uint8. The failures of `TestTensorCreationCPU.test_float_to_int_conversion_finite_cpu_uint8` came from the divergent values of PyTorch and numpy among platforms. This PR adds two items: - Enhance `_float_to_int_conversion_helper()` to have given reference values to provide the stable reference value - Omit a test for `float.max` since the results on PyTorch are divergent (e.g. `float.max` -> `uint8` is 0 on x86_64, or 255 on s390x). Fixes #97794 Pull Request resolved: https://github.com/pytorch/pytorch/pull/98916 Approved by: https://github.com/dagitses
Author
Committer
Parents
Loading