Skip to content

Commit 75568a7

Browse files
Skip unregistering optional inputs/outputs that are empty (#1467)
Signed-off-by: Tom Wildenhain <[email protected]>
1 parent 2ad402e commit 75568a7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tf2onnx/graph.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,8 @@ def remove_node(self, node_name):
691691
self.inputs.remove(node)
692692

693693
for op_output in node.output:
694+
if op_output == "":
695+
continue
694696
del self._output_to_node_name[op_output]
695697

696698
if op_output in self._output_shapes:
@@ -699,6 +701,8 @@ def remove_node(self, node_name):
699701
del self._dtypes[op_output]
700702

701703
for op_input in node.input:
704+
if op_input == "":
705+
continue
702706
utils.make_sure(
703707
op_input in self._output_to_consumers,
704708
"Input %r of node %r not found.", op_input, node_name)

0 commit comments

Comments
 (0)