-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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] [Relay] Update unique operator to match ONNX output (1D only) #8099
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…aiming it was indices)
…d/onnx.py debugging print statements
@mbrookhart please help to manage this PR |
mbrookhart
approved these changes
Jun 1, 2021
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.
LGTM. Thanks @electriclilies @tqchen
Thanks @mbrookhart! |
mehrdadh
pushed a commit
to mehrdadh/tvm
that referenced
this pull request
Jun 3, 2021
…pache#8099) * Fix topi test case and docs (tvm was returning inverse_indices and claiming it was indices) * Passes on CPU, fix unique op test * more changes * mtrying to fix optional outputs in onnx importer * TupleGetItem is being passed a stringgit add python/tvm/relay/frontend/onnx.py debugging print statements * Unique is passing onnx unit tests * fix indices * change comment * fix return of compute unique * black * fix lint * Some stray .asnumpy()s got through my merge, fix) * fix lint * revert changed .numpys * missed a few * fix more .asnumpy * fix black * Fix op level 3 test * remove prints * Fix pytorch and tf importers * black * fix lint * fix indentation * fix topi test
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
Jun 17, 2021
…pache#8099) * Fix topi test case and docs (tvm was returning inverse_indices and claiming it was indices) * Passes on CPU, fix unique op test * more changes * mtrying to fix optional outputs in onnx importer * TupleGetItem is being passed a stringgit add python/tvm/relay/frontend/onnx.py debugging print statements * Unique is passing onnx unit tests * fix indices * change comment * fix return of compute unique * black * fix lint * Some stray .asnumpy()s got through my merge, fix) * fix lint * revert changed .numpys * missed a few * fix more .asnumpy * fix black * Fix op level 3 test * remove prints * Fix pytorch and tf importers * black * fix lint * fix indentation * fix topi test
trevor-m
pushed a commit
to neo-ai/tvm
that referenced
this pull request
Jun 17, 2021
…pache#8099) * Fix topi test case and docs (tvm was returning inverse_indices and claiming it was indices) * Passes on CPU, fix unique op test * more changes * mtrying to fix optional outputs in onnx importer * TupleGetItem is being passed a stringgit add python/tvm/relay/frontend/onnx.py debugging print statements * Unique is passing onnx unit tests * fix indices * change comment * fix return of compute unique * black * fix lint * Some stray .asnumpy()s got through my merge, fix) * fix lint * revert changed .numpys * missed a few * fix more .asnumpy * fix black * Fix op level 3 test * remove prints * Fix pytorch and tf importers * black * fix lint * fix indentation * fix topi test
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The unique operator in TVM did not match the ONNX output. In this PR, I make changes to Unique so that the 1D ONNX unit tests passes. The changes are:
Correcting the documentation and order of return values in Relay code, topi code and in testing code. The documentation currently says that TVM's unique op returns
indices
, which is"A 1-D tensor. The same size as output. For each entry in output, it contains the index of its first occurance in the input data. The end of the tensor is padded with the length of the input data".
However, the op was actually returning
inverse_indices
, which is:"A 1-D tensor. For each entry in data, it contains the index of that data element in the unique array."
To fix this, I renamed
indices
asinverse_indices
and updated the documentation accordingly.Adding
indices
(the correct version) as an output to UniqueAdding Unique to the ONNX importer
Fixing a bug in the ONNX importer which caused ops with multiple optional outputs to not import
@mbrookhart Please take a look!