形状= []的Tensorflow tf.placeholder

时间:2018-09-03 23:55:28

标签: python tensorflow deep-learning shapes computation-graph

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

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

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

1 个答案:

答案 0 :(得分:1)

其排名为0,即A 0-D tensor. A scalar. https://www.tensorflow.org/guide/tensors#shape