1

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.

Milo Lu
  • 3,176
  • 3
  • 35
  • 46
Gaurav Srivastava
  • 505
  • 1
  • 7
  • 17

1 Answers1

5

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

BugKiller
  • 1,470
  • 1
  • 13
  • 22