From bc4606922578d2efab4d75425e15b8c380973b59 Mon Sep 17 00:00:00 2001 From: liu zhengxi <380185688@qq.com> Date: Wed, 21 Oct 2020 16:32:48 +0800 Subject: [PATCH] fix dynamic decode imperative (#28160) --- 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 079187e09c..05272a7cef 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