Skip to content

Commit 26bdcff

Browse files
authored
Update tf_loader.py (#2159)
freeze_session(): removed unnecessary slices which literally do nothing if we take the first element anyway Signed-off-by: DLumi <[email protected]>
1 parent 276bdea commit 26bdcff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tf2onnx/tf_loader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ def from_function(func, input_names, output_names, large_model=False):
290290

291291
def freeze_session(sess, input_names=None, output_names=None, get_tables=False):
292292
"""Freezes the state of a session into a pruned computation graph."""
293-
output_node_names = [i.split(':')[:-1][0] for i in output_names]
294-
keep_var_names = [i.split(':')[:-1][0] for i in input_names]
293+
output_node_names = [i.split(':')[0] for i in output_names]
294+
keep_var_names = [i.split(':')[0] for i in input_names]
295295
with sess.graph.as_default():
296296
output_node_names = output_node_names or []
297297
output_node_names += [v.op.name for v in tf_global_variables()]

0 commit comments

Comments
 (0)