For any queries you can reach us at / WhatsApp us: +919158876092

TensorFlow Placeholder

TensorFlow Placeholder

A placeholder has the role of feeding the tensor. The Data to flow inside the tensors are initialize by Placeholder. To provide a placeholder, we need to use the method feed_dict. The placeholder will be fed only within a session.

tf.placeholder(dtype,shape=None,name=None )


  • `dtype`: Type of data
  • `shape`: the dimension of the placeholder. Optional. By default, the shape of the data
  • `name`: Name of the placeholder. Optional
import tensorflow as tf  
data_placeholder_a = tf.placeholder(tf.float32, name = "data_placeholder_a")  

The output will be Tensor("data_placeholder_a:0", dtype=float32)