Skip to content
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

Merged
merged 24 commits into from Jul 3, 2019
Merged

Improve OnnxOperator to support more types #205

merged 24 commits into from Jul 3, 2019

Conversation

xadupre
Copy link
Collaborator

@xadupre xadupre commented Jun 25, 2019

No description provided.

@@ -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
Copy link
Contributor

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?

Copy link
Collaborator Author

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.

@xadupre xadupre merged commit ad1987d into onnx:master Jul 3, 2019
@xadupre xadupre deleted the ops branch December 15, 2020 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants