From 5d94a5ca54fe8cb419a87e3d27f0744eaa34b2a1 Mon Sep 17 00:00:00 2001 From: liu zhengxi <380185688@qq.com> Date: Wed, 21 Oct 2020 17:34:39 +0800 Subject: [PATCH] fix dynamic decode imperative (#28162) --- python/paddle/fluid/layers/rnn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/paddle/fluid/layers/rnn.py b/python/paddle/fluid/layers/rnn.py index 079187e09c9..05272a7cefb 100644 --- a/python/paddle/fluid/layers/rnn.py +++ b/python/paddle/fluid/layers/rnn.py @@ -1395,7 +1395,7 @@ def _dynamic_decode_imperative(decoder, control_flow.increment(x=step_idx_tensor, value=1.0, in_place=True) step_idx += 1 - control_flow.logical_not(nn.reduce_all(finished), cond) + cond = control_flow.logical_not(nn.reduce_all(finished)) if max_step_num is not None and step_idx > max_step_num: break -- GitLab