New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve OnnxOperator to support more types #205
Conversation
@@ -70,14 +70,21 @@ def _add_constant(self, cst): | |||
self.operator_name + 'cst') | |||
if cst.dtype in (np.float32, np.float64): | |||
ty = onnx_proto.TensorProto.FLOAT | |||
astype = np.float64 | |||
elif cst.dtype == np.int32: | |||
ty = onnx_proto.TensorProto.INT32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are setting this to INT32 but typecasting to int64 in line 87. Is that what you intended to do, could you explain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it is a bug or not but in onnx.helper.py, https://github.com/onnx/onnx/blob/master/onnx/helper.py#L231, the function check that number of float64 (not float32) so I'm just trying to avoid the exception at line https://github.com/onnx/onnx/blob/master/onnx/helper.py#L251.
No description provided.