diff -uNr pytorch/torch/csrc/autograd/python_function.cpp pytorch.mod/torch/csrc/autograd/python_function.cpp --- pytorch/torch/csrc/autograd/python_function.cpp 2022-10-03 21:59:02.604422931 +0900 +++ pytorch.mod/torch/csrc/autograd/python_function.cpp 2022-10-03 23:39:51.207871384 +0900 @@ -448,7 +448,7 @@ } else { throw torch::TypeError( "save_for_backward can only save variables, but argument %ld is of " - "type %s", i, Py_TYPE(obj)->tp_name); + "type %s", (long)(i), Py_TYPE(obj)->tp_name); } } // Free .to_save diff -uNr pytorch/torch/csrc/utils/python_arg_parser.h pytorch.mod/torch/csrc/utils/python_arg_parser.h --- pytorch/torch/csrc/utils/python_arg_parser.h 2022-10-03 19:00:05.000000000 +0900 +++ pytorch.mod/torch/csrc/utils/python_arg_parser.h 2022-10-03 23:39:46.263853740 +0900 @@ -423,7 +423,7 @@ } catch (const std::exception &e) { throw TypeError("%s(): argument '%s' must be %s, but found element of type %s at pos %ld", signature.name.c_str(), signature.params[i].name.c_str(), - signature.params[i].type_name().c_str(), Py_TYPE(obj)->tp_name, idx + 1); + signature.params[i].type_name().c_str(), Py_TYPE(obj)->tp_name, (long)(idx + 1)); } } return res; @@ -450,7 +450,7 @@ } catch (const std::exception &e) { throw TypeError("%s(): argument '%s' must be %s, but found element of type %s at pos %ld", signature.name.c_str(), signature.params[i].name.c_str(), - signature.params[i].type_name().c_str(), Py_TYPE(obj)->tp_name, idx + 1); + signature.params[i].type_name().c_str(), Py_TYPE(obj)->tp_name, (long)(idx + 1)); } } return res;