Tensorflow placeholder

Tensorflow placeholder

Placeholder is a placeholder node of TensorFlow. It is created by the placeholder method. It is also a constant, but it is passed by the user when calling the run method. Placeholder can also be understood as a formal parameter. That is, it is not directly usable like constant, and requires the user to pass a constant value.

Create method

X = tf.placeholder(dtype=tf.float32, shape=[144, 10], name='X')

Parameter Description

dtype : data type, required, the default is the data type of value, the incoming parameter is the enumeration value under tensorflow (float32, float64...)

shape : The shape of the data, optional, if not filled, it will change with the shape of the incoming data. You can pass in data of different shapes in multiple calls

name : Constant name, optional, the default value is not repeated, according to the order of creation (Placeholder, Placeholder_1, Placeholder_2...)

Guess you like

Origin blog.csdn.net/qq_44082148/article/details/101390738