Skip to content

Commit

Permalink
Fix beam decoding end-condition bug.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 309795875
  • Loading branch information
trax-robot authored and Copybara-Service committed May 4, 2020
1 parent d8b7833 commit 16c2e39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion trax/models/beam_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def beam_search(batch_size,
def beam_search_loop_cond_fn(state):
"""Beam search loop termination condition."""
# Have we reached max decoding length?
not_at_end = (state.cur_index <= max_decode_len)
not_at_end = (state.cur_index < max_decode_len - 1)

# Is no further progress in the beam search possible?
# Get the best possible scores from alive sequences.
Expand Down

0 comments on commit 16c2e39

Please sign in to comment.