Tensorflow tf.placeholder with shape = []

GAU*_*AVA 1 python shapes deep-learning tensorflow computation-graph

我正在查看一个 Tensorflow 代码,该代码使用形状 = [] 的占位符将学习率输入到图形中,如下所示:

self.lr_placeholder = tf.placeholder(dtype=tf.float32, shape=[])
Run Code Online (Sandbox Code Playgroud)

我查看了 Tensorflow ( https://www.tensorflow.org/api_docs/python/tf/placeholder )的官方文档页面以了解 shape=[] 的含义,但无法获得形状设置为空的解释列表。如果有人可以解释这是什么意思。

Bug*_*ler 5

它的等级为 0,即A 0-D tensor. A scalar. https://www.tensorflow.org/guide/tensors#shape