TensorFlow学习之placeholder
源码
def placeholder(dtype, shape=None, name=None):
“”"Inserts a placeholder for a tensor that will be always fed.
为将总是要被喂入的张量插入一个占位符
Important: This tensor will produce an error if evaluated. Its value must be fed using the feed_dict
optional argument to Session.run()
, Tensor.eval()
, or Operation.run()
.
如果计算这个张量会产生误差,它必须要通过可选参数 feed_dict
喂入到Session.run()
, Tensor.eval()
, or Operation.run()
.
For example:
x = tf.placeholder(tf.float32, shape=(