Fix conversion of values in libtorch agnostic tests (#155115)

Due to different byteorder,
when copying data, it has to be put into last bytes to ensure that int32_t converted to int64_t keeps same value. Same has to be done when it's converted back.

This change fixes test
TestLibtorchAgnosticCPU::test_my_ones_like_cpu
from
cpp_extensions/libtorch_agnostic_extension/test/test_libtorch_agnostic.py on s390x.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/155115
Approved by: https://github.com/huydhn
This commit is contained in:
Aleksei Nikiforov
2025-08-04 13:40:18 +00:00
committed by PyTorch MergeBot
parent 3e2aa4b0e3
commit e5a81aa7ba
2 changed files with 27 additions and 1 deletions

View File

@ -239,7 +239,6 @@ S390X_BLOCKLIST = [
# some false errors
"doctests",
# new failures to investigate and fix
"cpp_extensions/libtorch_agnostic_extension/test/test_libtorch_agnostic",
"test_tensorboard",
# onnx + protobuf failure, see
# https://github.com/protocolbuffers/protobuf/issues/22104