-
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] Support optional outputs for ONNX nodes #7818
Conversation
valid_outputs[i] = True | ||
if not all(valid_outputs): | ||
tup = op.astuple() | ||
if isinstance(tup, _expr.Tuple): |
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.
Does op.astuple
not always return an _expr.Tuple
?
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.
No, we use TupleWrapper for other nodes, like call nodes with multiple outputs, see split:
tvm/python/tvm/relay/op/transform.py
Line 861 in 461d06e
return TupleWrapper(_make.split(data, indices_or_sections, axis), ret_size) |
LGTM, i think a few comments explaining the logic here would be helpful though. |
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.
Thanks @mbrookhart @jwfromm
* Support optional outputs for ONNX nodes * add comments
* Support optional outputs for ONNX nodes * add comments
* Support optional outputs for ONNX nodes * add comments
* Support optional outputs for ONNX nodes * add comments
Also enables some cast tests that were incorrectly skipped.