【发布时间】:2018-04-17 13:47:02
【问题描述】:
如何使以下扫描示例起作用?我打算用这个例子来测试函数f中的一些代码。
def f(prev_y, curr_y):
fval = tf.nn.softmax(curr_y)
return fval
a = tf.constant([[.1, .25, .3, .2, .15],
[.07, .35, .27, .17, .14]])
c = tf.scan(f, a, initializer=0)
with tf.Session() as sess:
print(sess.run(c))
【问题讨论】:
标签: python tensorflow scanning