@@ -74,7 +74,6 @@ def not_implemented_tf_placeholder(*args, **kwargs):
74
74
tf_gfile = tf .io .gfile
75
75
tf_placeholder = tf .compat .v1 .placeholder
76
76
tf_placeholder_with_default = tf .compat .v1 .placeholder_with_default
77
- extract_sub_graph = tf .compat .v1 .graph_util .extract_sub_graph
78
77
elif Version (tf .__version__ ) >= Version ("1.13" ):
79
78
# 1.13 introduced the compat namespace
80
79
tf_reset_default_graph = tf .compat .v1 .reset_default_graph
@@ -85,7 +84,6 @@ def not_implemented_tf_placeholder(*args, **kwargs):
85
84
tf_gfile = tf .gfile
86
85
tf_placeholder = tf .compat .v1 .placeholder
87
86
tf_placeholder_with_default = tf .compat .v1 .placeholder_with_default
88
- extract_sub_graph = tf .compat .v1 .graph_util .extract_sub_graph
89
87
else :
90
88
# older than 1.13
91
89
tf_reset_default_graph = tf .reset_default_graph
@@ -96,7 +94,6 @@ def not_implemented_tf_placeholder(*args, **kwargs):
96
94
tf_gfile = tf .gfile
97
95
tf_placeholder = tf .placeholder
98
96
tf_placeholder_with_default = tf .placeholder_with_default
99
- extract_sub_graph = tf .graph_util .extract_sub_graph
100
97
101
98
102
99
def inputs_without_resource (sess , input_names ):
@@ -709,11 +706,6 @@ def tf_optimize(input_names, output_names, graph_def):
709
706
assert isinstance (input_names , list )
710
707
assert isinstance (output_names , list )
711
708
712
- # TODO: is this needed ?
713
- needed_names = [utils .node_name (i ) for i in input_names ] + \
714
- [utils .node_name (i ) for i in output_names ]
715
- graph_def = extract_sub_graph (graph_def , needed_names )
716
-
717
709
want_grappler = is_tf2 () or Version (tf .__version__ ) >= Version ("1.15" )
718
710
if want_grappler :
719
711
graph_def = tf_optimize_grappler (input_names , output_names , graph_def )
0 commit comments