Tensorflow tf.placeholder with shape = []

1.3k Views Asked by At

I am looking at a Tensorflow code that has learning rate input to the graph using placeholder with shape = [], as below:

self.lr_placeholder = tf.placeholder(dtype=tf.float32, shape=[])

I looked at the official documentation page of Tensorflow (https://www.tensorflow.org/api_docs/python/tf/placeholder) to understand what would shape=[] mean, but could not get an explanation for the shape set to empty list. If someone can explain what does this mean.

1

There are 1 best solutions below

0
On BEST ANSWER

its rank is 0, i.e. A 0-D tensor. A scalar. https://www.tensorflow.org/guide/tensors#shape