'Extend the hypothesis with result from latest step.
Args:
token: latest token from decoding.
log_prob: log prob of the latest decoded tokens.
new_state: decoder output state. Fed to the decoder for next step.
Returns:
New Hypothesis with the results from latest step.'

def Extend(self, token, log_prob, new_state):

    return Hypothesis((self.tokens + [token]), (self.log_prob + log_prob), new_state)
