diff --git a/python/paddle/fluid/layers/rnn.py b/python/paddle/fluid/layers/rnn.py index 079187e09c916a8410448163361c9042d99faaf3..05272a7cefb0827517c22b38b8b85ccdb3036fcc 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