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

[ONNX] Wrap 'If' if it has multiple outputs #8385

Merged
merged 3 commits into from
Jul 7, 2021

Conversation

karljang
Copy link
Contributor

@karljang karljang commented Jul 1, 2021

Without this wrapper, an assertion in from_onnx() will fail with the
error message showing "Number of output mismatch"

The assertion check is here: https://github.com/apache/tvm/blob/main/python/tvm/relay/frontend/onnx.py#L3597

Without this wrapper, an assertion in from_onnx() will fail with the
error message showing ""Number of output mismatch"
@jwfromm
Copy link
Contributor

jwfromm commented Jul 2, 2021

Thanks for this fix, it makes sense to me. Can you add a test case that triggers the previous error to tests/python/frontend/onnx/test_forward.py? Take a look at the current test for If and see if you can modify it to optionally have multiple outputs.

@jwfromm jwfromm self-requested a review July 2, 2021 21:57
@karljang
Copy link
Contributor Author

karljang commented Jul 2, 2021

@jwfromm
Thanks for the link!
I just modified the current test case to cover multiple output cases~

Copy link
Contributor

@jwfromm jwfromm left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for adding these tests. I think you just need to fix some formatting to pass CI's sanity check. You can do that by running make format or black whatever.py.

@karljang
Copy link
Contributor Author

karljang commented Jul 5, 2021

@jwfromm
Fixed the formatting issues, thank you for your review and tips~

@masahi masahi merged commit 2628179 into apache:main Jul 7, 2021
@karljang karljang deleted the support-tuple-from-If branch July 7, 2021 05:35
@jwfromm
Copy link
Contributor

jwfromm commented Jul 7, 2021

@karljang This is now merged. Thanks for taking the initiative to make this fix and congrats on your first commit!

@karljang
Copy link
Contributor Author

karljang commented Jul 7, 2021

@jwfromm
Thank you! It was a pleasant, first commit for me, thanks to your help.

ylc pushed a commit to ylc/tvm that referenced this pull request Sep 29, 2021
* [ONNX] Wrap 'If' if it has multiple outputs

Without this wrapper, an assertion in from_onnx() will fail with the
error message showing ""Number of output mismatch"

* [ONNX] Test If nodes with multiple output tensors

* Fix formatting issues
zxy844288792 pushed a commit to zxy844288792/tvm that referenced this pull request Mar 4, 2022
* [ONNX] Wrap 'If' if it has multiple outputs

Without this wrapper, an assertion in from_onnx() will fail with the
error message showing ""Number of output mismatch"

* [ONNX] Test If nodes with multiple output tensors

* Fix formatting issues
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