Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion onnx2torch/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,13 @@ def convert( # pylint: disable=too-many-locals, too-many-branches, too-many-sta
torch_input_node = torch_nodes[onnx_input_node.unique_name]

# Get only one needed output of torch_input_node by index
if len(onnx_input_node.output_values) > 1:
if len(onnx_input_node.output_values) > 1 or onnx_input_node.proto.op_type in (
'If',
'Loop',
'Scan',
'SequenceMap',
'Split',
):
index = onnx_input_node.output_values.index(value_name)
torch_input_node = torch_graph.call_function(getitem, args=(torch_input_node, index))
torch_nodes[name + '_split_output'] = torch_input_node
Expand Down