我试过下面的代码。但我在张量流中找不到不可喂养的东西。谁能告诉我什么是不可喂养的吗?在
#!/usr/bin/env python
# vim: set noexpandtab tabstop=2 shiftwidth=2 softtabstop=-1 fileencoding=utf-8:
import tensorflow as tf
x = tf.Variable(3)
y = tf.constant(3)
z = tf.add(1, 2)
with tf.Session() as sess:
print sess.graph.is_feedable(x)
print sess.graph.is_feedable(y)
print sess.graph.is_feedable(z)
除非通过^{} 方法显式地阻止它们输入,否则所有张量都是可馈的(包括常量)。可以直接或间接调用此方法,例如,^{} 函数就是这样做的:
样本代码:
相关问题 更多 >
编程相关推荐