Skip to content

Commit 5115124

Browse files
committed
removed unnecessary lines
1 parent bb4d9a6 commit 5115124

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

tf2onnx/graph.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -642,9 +642,9 @@ def remove_node(self, node_name):
642642
del self._dtypes[op_output]
643643

644644
for op_input in node.input:
645-
if op_input not in self._output_to_consumers:
646-
raise RuntimeError(
647-
"Input %r of node %r not found." % (op_input, node_name))
645+
utils.make_sure(
646+
op_input in self._output_to_consumers,
647+
"Input %r of node %r not found.", op_input, node_name))
648648
self._unregister_input_name(op_input, node)
649649

650650
self._nodes.remove(node)
@@ -684,11 +684,6 @@ def reset_nodes(self, ops):
684684
for o in self.outputs:
685685
if o not in self._output_to_node_name:
686686
raise ValueError("graph output " + o + " not exist")
687-
for i in self.inputs:
688-
if i.is_graph_input():
689-
continue
690-
if i.name not in self._output_to_consumers:
691-
raise ValueError("graph input %r not exist in graph." % i.name)
692687

693688
self._dtypes = remained_dtypes
694689
self._output_shapes = remained_shapes

0 commit comments

Comments
 (0)