- Hands-On Reinforcement Learning with Python
- Sudharsan Ravichandiran
- 100字
- 2021-06-18 19:12:08
Placeholders
Think of placeholders as variables where you only define the type and dimension but will not assign the value. Placeholders are defined with no values. Values for the placeholders will be fed at runtime. Placeholders have an optional argument called shape, which specifies the dimensions of the data. If the shape is set to None then we can feed data of any size at runtime. Placeholders can be defined using the tf.placeholder() function:
x = tf.placeholder("float", shape=None)
To put it in simple terms, we use tf.Variable to store the data and tf.placeholder for feeding the external data.