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

Update Cast handlers for version 9 #368

Merged
merged 1 commit into from
Feb 22, 2019

Conversation

chinhuang007
Copy link
Collaborator

The Cast operator was updated in ONNX opset version 9, causning
frontend and backend conversion to fail.

This PR should fix the issue:
#362

@ibm-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@chinhuang007 chinhuang007 force-pushed the update-cast branch 3 times, most recently from a769e91 to 477a5d6 Compare February 7, 2019 01:06
@classmethod
def version_9(cls, node, **kwargs):
inp = kwargs["tensor_dict"][node.inputs[0]]
if (node.attrs.get("to") == tf.string):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like casting from string type would cause problem?
For instance, if we want to convert "100" to 100, this handler would err.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tjingrant good catch! Updated handler and test code to cover cast from strings. Please review.

@chinhuang007 chinhuang007 force-pushed the update-cast branch 2 times, most recently from a390a9b to c525605 Compare February 15, 2019 18:52
Copy link
Collaborator

@fumihwh fumihwh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

The Cast operator was updated in ONNX opset version 9, causning
frontend and backend conversion to fail.

This PR should fix the issue:
onnx#362
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

4 participants