提交 15c5a3bc 编写于 作者: G Gaurav Jain 提交者: TensorFlower Gardener

Reduce flakiness of testScanCapturesVariables

PiperOrigin-RevId: 225017976
上级 f7a9503c
......@@ -811,7 +811,7 @@ class CTCLossTestV2(test.TestCase):
x = random_ops.random_uniform([])
fn = lambda accum, elem: accum + x * elem
out = ctc_ops._scan(fn, constant_op.constant([0.0, 1.0, 2.0]), 23.0)
self.assertAllEqual(*sess.run([
self.assertAllClose(*sess.run([
[23.0 + x * 0.0, 23.0 + x * 1.0, 23.0 + x * 3.0], out
]))
......
......@@ -1029,7 +1029,7 @@ def _scan(fn, elems, initial, reverse=False, inclusive=False, final_only=False):
for the forward backward use case.
Examples:
scan(lambda a, e: a + e, [1.0, 2.0, 3.0], 1.0) => [2.0, 3.0, 4.0]
scan(lambda a, e: a + e, [1.0, 2.0, 3.0], 1.0) => [2.0, 4.0, 7.0]
Multiple accumulators:
scan(lambda a, e: (a[0] + e, a[1] * e), [1.0, 2.0, 3.0], (0.0, 1.0))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册