Fix to correctly read the step returned values
@@ -335,8 +335,9 @@ class Decoder(object):
def _symbols_to_logits_fn(ids, step, state):
inputs = embedding_fn(ids[:, -1])
returned_values = step_fn(step, inputs, state["decoder"], mode)
- if "attention" in state:
+ if self.support_alignment_history:
outputs, state["decoder"], attention = returned_values
+ if "attention" in state:
state["attention"] = tf.concat([state["attention"], tf.expand_dims(attention, 1)], 1)
else:
outputs, state["decoder"] = returned_values
