我在学张量流
import tensorflow as tf
print(tf.VERSION)
a = tf.placeholder(tf.float32, shape=[3])
b = tf.constant([2, 2, 2], tf.float32)
c = a + b
with tf.Session() as sess:
print(tf.get_default_graph().is_feedable(b))
print(sess.run(c, feed_dict={a: [3, 2, 3]}))
结果如下
^{pr2}$我不明白为什么张量流说常数是可馈的。占位符是feedable true,但为什么是常量?在
因为在TF中,您还可以feed values in constants and variables:
你自己检查一下:
常量
a
更改了其值。在相关问题 更多 >
编程相关推荐