@@ -1173,7 +1173,7 @@ def dump_node_statistics(self):
1173
1173
op_cnt [n .type ] += 1
1174
1174
body_graphs = n .get_body_graphs ()
1175
1175
if body_graphs :
1176
- for _ , b_g in body_graphs .items ():
1176
+ for b_g in body_graphs .values ():
1177
1177
op_cnt += b_g .dump_node_statistics ()
1178
1178
1179
1179
return op_cnt
@@ -1272,7 +1272,7 @@ def find_output_consumers(self, output_name):
1272
1272
1273
1273
# find consumers in sub graphs
1274
1274
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 ():
1276
1276
nodes .extend (g .find_output_consumers (output_name ))
1277
1277
return nodes
1278
1278
@@ -1292,7 +1292,7 @@ def _unregister_input_name(self, input_name, node, only_graph=False):
1292
1292
"Unregister node taking a specific input."
1293
1293
node_name = node .name
1294
1294
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 ]:
1296
1296
if node_name in self ._input_to_node_name [input_name ]:
1297
1297
self ._input_to_node_name [input_name ].remove (node_name )
1298
1298
if (self .parent_graph is not None and
@@ -1335,7 +1335,7 @@ def replace_all_inputs(self, ops, old_input, new_input):
1335
1335
1336
1336
# modify references in sub graphs
1337
1337
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 ():
1339
1339
g .replace_all_inputs (g .get_nodes () if keep_ops else None , old_input , new_input )
1340
1340
1341
1341
def replace_input (self , node , old_input , new_input , input_index = None ):
@@ -1456,7 +1456,7 @@ def delete_unused_nodes(self, outputs_name):
1456
1456
for node in related_nodes :
1457
1457
attr_body_graphs = node .get_body_graphs ()
1458
1458
if attr_body_graphs :
1459
- for _ , body_graph in attr_body_graphs .items ():
1459
+ for body_graph in attr_body_graphs .values ():
1460
1460
body_graph .delete_unused_nodes (body_graph .outputs )
1461
1461
self .reset_nodes (related_nodes )
1462
1462
0 commit comments