Bugfix in onnx exporter (#10607)
Summary:
Incorrect processing for int and float arguments. Possibly a typo.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/10607
Differential Revision: D9376040
Pulled By: bddppq
fbshipit-source-id: e3665e7bbb26842d1d7eed50442993cfdbf55a80
diff --git a/caffe2/onnx/onnx_exporter.cc b/caffe2/onnx/onnx_exporter.cc
index 9dc4ea3..fbdf51d 100644
--- a/caffe2/onnx/onnx_exporter.cc
+++ b/caffe2/onnx/onnx_exporter.cc
@@ -428,8 +428,9 @@
std::transform(
c2_dtype.begin(), c2_dtype.end(), c2_dtype.begin(), ::toupper);
if (c2_dtype == "FLOAT") {
- } else if (c2_dtype == "INT32") {
onnx_dtype = ::ONNX_NAMESPACE::TensorProto::FLOAT;
+ } else if (c2_dtype == "INT32") {
+ onnx_dtype = ::ONNX_NAMESPACE::TensorProto::INT32;
} else if (c2_dtype == "BOOL") {
onnx_dtype = ::ONNX_NAMESPACE::TensorProto::BOOL;
} else if (c2_dtype == "UINT8") {