简体   繁体   中英

Tensorflow tf.placeholder with shape = []

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM