You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/04/09 19:38:46 UTC

[GitHub] [tvm] mbrookhart commented on a change in pull request #7818: [ONNX] Support optional outputs for ONNX nodes

mbrookhart commented on a change in pull request #7818:
URL: https://github.com/apache/tvm/pull/7818#discussion_r610865204



##########
File path: python/tvm/relay/frontend/onnx.py
##########
@@ -3202,6 +3202,24 @@ def from_onnx(self, graph, opset, get_output_expr=False):
                 outputs_num = 1
             else:
                 outputs_num = len(op)
+            if outputs_num > 1:
+                valid_outputs = [False] * outputs_num
+                for i in range(len(node_output)):
+                    if node_output[i] != "":
+                        valid_outputs[i] = True
+                if not all(valid_outputs):
+                    tup = op.astuple()
+                    if isinstance(tup, _expr.Tuple):

Review comment:
       No, we use TupleWrapper for other nodes, like call nodes with multiple outputs, see split: https://github.com/apache/tvm/blob/461d06eb5cfc7954f1983779acd05c47cea269f1/python/tvm/relay/op/transform.py#L861




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org