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

Add cast to same type before equal operator #1089

Merged
merged 2 commits into from
Sep 29, 2020

Conversation

bedapisl
Copy link
Contributor

@bedapisl bedapisl commented Sep 2, 2020

  • Operands of Equal must be of the same type (onnx documentation). This PR adds necessary casts before Equal.
  • Output of Size operation should be Int64 (documentation). This PR fixes a problem when the output of Size was internally Int32.

This allows for example this model: https://drive.google.com/file/d/105xs9j1PjzKk45PkM5-hGNKxGTdElsCL/view?usp=sharing to be correctly converted and loaded with onnxruntime. Without the proposed changes the converted model is not valid (microsoft/onnxruntime#4997).

@CLAassistant
Copy link

CLAassistant commented Sep 2, 2020

CLA assistant check
All committers have signed the CLA.

@bedapisl bedapisl changed the title Add cast to same type before equal operator [WIP] Add cast to same type before equal operator Sep 2, 2020
@bedapisl bedapisl force-pushed the fix_equal branch 2 times, most recently from 5cd7db5 to 4bf83c8 Compare September 7, 2020 07:05
@bedapisl bedapisl changed the title [WIP] Add cast to same type before equal operator Add cast to same type before equal operator Sep 7, 2020
Copy link
Contributor

@TomWildenhain-Microsoft TomWildenhain-Microsoft left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! Please move the test to test_backend.py


class EqualTests(Tf2OnnxBackendTestBase):

def test_equal_with_different_parameters(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Put this test in test_backend.py under test_equal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done :)

@bedapisl bedapisl force-pushed the fix_equal branch 2 times, most recently from f100430 to 030abc7 Compare September 29, 2020 12:10
Signed-off-by: bedapisl <bedapisl@gmail.com>
Signed-off-by: bedapisl <bedapisl@gmail.com>
Copy link
Contributor

@TomWildenhain-Microsoft TomWildenhain-Microsoft left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

@TomWildenhain-Microsoft TomWildenhain-Microsoft merged commit 2cf8854 into onnx:master Sep 29, 2020
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.

3 participants