aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/framework/python/framework/graph_util.py
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/contrib/framework/python/framework/graph_util.py')
-rw-r--r--tensorflow/contrib/framework/python/framework/graph_util.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tensorflow/contrib/framework/python/framework/graph_util.py b/tensorflow/contrib/framework/python/framework/graph_util.py
index a18ff2320d..49eec3a3f1 100644
--- a/tensorflow/contrib/framework/python/framework/graph_util.py
+++ b/tensorflow/contrib/framework/python/framework/graph_util.py
@@ -133,6 +133,18 @@ def fuse_op(graph_def, input_nodes, output_nodes, output_dtypes,
def get_placeholders(graph):
"""Get placeholders of a graph.
+ For example:
+
+ ```python
+ a = tf.placeholder(dtype=tf.float32, shape=[2, 2], name='a')
+ a = tf.placeholder(dtype=tf.int32, shape=[3, 2], name='b')
+
+ tf.contrib.framework.get_placeholders(tf.get_default_graph())
+ # Returns:
+ # [<tf.Tensor 'a:0' shape=(2, 2) dtype=float32>,
+ # <tf.Tensor 'b:0' shape=(3, 2) dtype=int32>]
+ ```
+
Args:
graph: A tf.Graph.
Returns: