Skip to content

Commit 522560a

Browse files
committed
_handle_node_having_branches only handle node which only has one output
so adding an condtion to avoid enter the function since it will throw an exception directly.
1 parent ac71b6c commit 522560a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tf2onnx/optimizer/transpose_optimizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def _handle_node_having_branches(self, node):
197197
return False
198198
# make sure node's all input transpose all have only 1 consumer node,
199199
# otherwise, it would impact their other output nodes
200-
if self._nodes_has_single_consumer_node(node.inputs):
200+
if self._nodes_has_single_consumer_node(node.inputs) and len(node.output) == 1:
201201
self._create_transpose_pairs_after_node(node)
202202
input_transposes = set(node.inputs)
203203
for n in input_transposes:

0 commit comments

Comments
 (0)