Skip to content

Commit 03e2bb7

Browse files
committed
addresses comments
1 parent 3db62e4 commit 03e2bb7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tf2onnx/graph.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,7 @@ def dump_node_statistics(self):
11731173
op_cnt[n.type] += 1
11741174
body_graphs = n.get_body_graphs()
11751175
if body_graphs:
1176-
for _, b_g in body_graphs.items():
1176+
for b_g in body_graphs.values():
11771177
op_cnt += b_g.dump_node_statistics()
11781178

11791179
return op_cnt
@@ -1272,7 +1272,7 @@ def find_output_consumers(self, output_name):
12721272

12731273
# find consumers in sub graphs
12741274
if output_name in self._input_to_graph:
1275-
for _, g in self._input_to_graph[output_name].items():
1275+
for g in self._input_to_graph[output_name].values():
12761276
nodes.extend(g.find_output_consumers(output_name))
12771277
return nodes
12781278

@@ -1292,7 +1292,7 @@ def _unregister_input_name(self, input_name, node, only_graph=False):
12921292
"Unregister node taking a specific input."
12931293
node_name = node.name
12941294
if not only_graph:
1295-
if node_name in self._input_to_node_name[input_name]:
1295+
if input_name in self._input_to_node_name[input_name]:
12961296
if node_name in self._input_to_node_name[input_name]:
12971297
self._input_to_node_name[input_name].remove(node_name)
12981298
if (self.parent_graph is not None and
@@ -1335,7 +1335,7 @@ def replace_all_inputs(self, ops, old_input, new_input):
13351335

13361336
# modify references in sub graphs
13371337
if old_input in self._input_to_graph:
1338-
for _, g in self._input_to_graph[old_input].items():
1338+
for g in self._input_to_graph[old_input].values():
13391339
g.replace_all_inputs(g.get_nodes() if keep_ops else None, old_input, new_input)
13401340

13411341
def replace_input(self, node, old_input, new_input, input_index=None):
@@ -1456,7 +1456,7 @@ def delete_unused_nodes(self, outputs_name):
14561456
for node in related_nodes:
14571457
attr_body_graphs = node.get_body_graphs()
14581458
if attr_body_graphs:
1459-
for _, body_graph in attr_body_graphs.items():
1459+
for body_graph in attr_body_graphs.values():
14601460
body_graph.delete_unused_nodes(body_graph.outputs)
14611461
self.reset_nodes(related_nodes)
14621462

0 commit comments

Comments
 (0)