tf.contrib.framework.get_placeholders
Stay organized with collections
Save and categorize content based on your preferences.
Get placeholders of a graph.
tf.contrib.framework.get_placeholders(
graph
)
For example:
a = tf.compat.v1.placeholder(dtype=tf.float32, shape=[2, 2], name='a')
a = tf.compat.v1.placeholder(dtype=tf.int32, shape=[3, 2], name='b')
tf.contrib.framework.get_placeholders(tf.compat.v1.get_default_graph())
# Returns:
# [<tf.Tensor 'a:0' shape=(2, 2) dtype=float32>,
# <tf.Tensor 'b:0' shape=(3, 2) dtype=int32>]
Returns |
A list contains all placeholders of given graph.
|
Raises |
TypeError
|
If graph is not a tensorflow graph.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.contrib.framework.get_placeholders\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/framework/python/framework/graph_util.py#L138-L171) |\n\nGet placeholders of a graph. \n\n tf.contrib.framework.get_placeholders(\n graph\n )\n\n#### For example:\n\n a = tf.compat.v1.placeholder(dtype=tf.float32, shape=[2, 2], name='a')\n a = tf.compat.v1.placeholder(dtype=tf.int32, shape=[3, 2], name='b')\n\n tf.contrib.framework.get_placeholders(tf.compat.v1.get_default_graph())\n # Returns:\n # [\u003ctf.Tensor 'a:0' shape=(2, 2) dtype=float32\u003e,\n # \u003ctf.Tensor 'b:0' shape=(3, 2) dtype=int32\u003e]\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|---------|-------------|\n| `graph` | A tf.Graph. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A list contains all placeholders of given graph. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|-------------|---------------------------------------|\n| `TypeError` | If `graph` is not a tensorflow graph. |\n\n\u003cbr /\u003e"]]