Remove tf.graph_util symbols from TF 2.0.
PiperOrigin-RevId: 220841246
This commit is contained in:
parent
fa926e3920
commit
8b6ddd0680
tensorflow
@ -29,6 +29,7 @@ from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.framework import ops
|
||||
from tensorflow.python.framework import tensor_util
|
||||
from tensorflow.python.platform import tf_logging as logging
|
||||
from tensorflow.python.util import deprecation
|
||||
from tensorflow.python.util.tf_export import tf_export
|
||||
|
||||
_VARIABLE_OPS = {
|
||||
@ -50,7 +51,10 @@ def _is_variable_op(op):
|
||||
return op in _VARIABLE_OPS
|
||||
|
||||
|
||||
@tf_export("graph_util.must_run_on_cpu")
|
||||
@deprecation.deprecated(
|
||||
date=None,
|
||||
instructions="Use tf.compat.v1.graph_util.must_run_on_cpu")
|
||||
@tf_export(v1=["graph_util.must_run_on_cpu"])
|
||||
def must_run_on_cpu(node, pin_variables_on_cpu=False):
|
||||
"""Returns True if the given node_def must run on CPU, otherwise False.
|
||||
|
||||
@ -149,7 +153,10 @@ def _bfs_for_reachable_nodes(target_nodes, name_to_input_name):
|
||||
return nodes_to_keep
|
||||
|
||||
|
||||
@tf_export("graph_util.extract_sub_graph")
|
||||
@deprecation.deprecated(
|
||||
date=None,
|
||||
instructions="Use tf.compat.v1.graph_util.extract_sub_graph")
|
||||
@tf_export(v1=["graph_util.extract_sub_graph"])
|
||||
def extract_sub_graph(graph_def, dest_nodes):
|
||||
"""Extract the subgraph that can reach any of the nodes in 'dest_nodes'.
|
||||
|
||||
@ -187,7 +194,10 @@ def extract_sub_graph(graph_def, dest_nodes):
|
||||
return out
|
||||
|
||||
|
||||
@tf_export("graph_util.tensor_shape_from_node_def_name")
|
||||
@deprecation.deprecated(
|
||||
date=None,
|
||||
instructions="Use tf.compat.v1.graph_util.remove_training_nodes")
|
||||
@tf_export(v1=["graph_util.tensor_shape_from_node_def_name"])
|
||||
def tensor_shape_from_node_def_name(graph, input_name):
|
||||
"""Convenience function to get a shape from a NodeDef's input string."""
|
||||
# To get a tensor, the name must be in the form <input>:<port>, for example
|
||||
@ -202,7 +212,10 @@ def tensor_shape_from_node_def_name(graph, input_name):
|
||||
return shape
|
||||
|
||||
|
||||
@tf_export("graph_util.convert_variables_to_constants")
|
||||
@deprecation.deprecated(
|
||||
date=None,
|
||||
instructions="Use tf.compat.v1.graph_util.convert_variables_to_constants")
|
||||
@tf_export(v1=["graph_util.convert_variables_to_constants"])
|
||||
def convert_variables_to_constants(sess,
|
||||
input_graph_def,
|
||||
output_node_names,
|
||||
@ -289,7 +302,10 @@ def convert_variables_to_constants(sess,
|
||||
return output_graph_def
|
||||
|
||||
|
||||
@tf_export("graph_util.remove_training_nodes")
|
||||
@deprecation.deprecated(
|
||||
date=None,
|
||||
instructions="Use tf.compat.v1.graph_util.remove_training_nodes")
|
||||
@tf_export(v1=["graph_util.remove_training_nodes"])
|
||||
def remove_training_nodes(input_graph, protected_nodes=None):
|
||||
"""Prunes out nodes that aren't needed for inference.
|
||||
|
||||
|
@ -1,27 +1,7 @@
|
||||
path: "tensorflow.graph_util"
|
||||
tf_module {
|
||||
member_method {
|
||||
name: "convert_variables_to_constants"
|
||||
argspec: "args=[\'sess\', \'input_graph_def\', \'output_node_names\', \'variable_names_whitelist\', \'variable_names_blacklist\'], varargs=None, keywords=None, defaults=[\'None\', \'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "extract_sub_graph"
|
||||
argspec: "args=[\'graph_def\', \'dest_nodes\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "import_graph_def"
|
||||
argspec: "args=[\'graph_def\', \'input_map\', \'return_elements\', \'name\', \'op_dict\', \'producer_op_list\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\', \'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "must_run_on_cpu"
|
||||
argspec: "args=[\'node\', \'pin_variables_on_cpu\'], varargs=None, keywords=None, defaults=[\'False\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "remove_training_nodes"
|
||||
argspec: "args=[\'input_graph\', \'protected_nodes\'], varargs=None, keywords=None, defaults=[\'None\'], "
|
||||
}
|
||||
member_method {
|
||||
name: "tensor_shape_from_node_def_name"
|
||||
argspec: "args=[\'graph\', \'input_name\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user