commit | bc0c74bcd5e5ce0a5a01425e59295f30275beae6 | [log] [tgz] |
---|---|---|
author | Aleksei Nikiforov <aleksei.nikiforov@linux.ibm.com> | Thu Apr 27 00:27:27 2023 +0000 |
committer | PyTorch MergeBot <pytorchmergebot@users.noreply.github.com> | Thu Apr 27 00:27:32 2023 +0000 |
tree | d2a0e6fd60948e571e5da96fe70ceaf8319165e6 | |
parent | 32a67e42c46caad977628b900c1cb3718e18e9da [diff] |
Don't apply _Py_OPCODE twice (#97986) It's already applied in PyInstDecoder::opcode. Applying it twice returns incorrect result on big endian systems. This change fixes 14 tests in test/functorch/test_dims.py on big endian systems. Pull Request resolved: https://github.com/pytorch/pytorch/pull/97986 Approved by: https://github.com/Skylion007, https://github.com/kit1980
diff --git a/functorch/csrc/dim/dim.cpp b/functorch/csrc/dim/dim.cpp index f204167..591b7a0 100644 --- a/functorch/csrc/dim/dim.cpp +++ b/functorch/csrc/dim/dim.cpp
@@ -1427,7 +1427,7 @@ // dim() -------------------- bool relevant_op(_Py_CODEUNIT c) { - switch(_Py_OPCODE(c)) { + switch(c) { case STORE_NAME: case STORE_GLOBAL: case STORE_FAST: