Skip to content

Commit

Permalink
clarity comment
Browse files Browse the repository at this point in the history
  • Loading branch information
vince62s committed Nov 2, 2023
1 parent e9db6b1 commit cbc7273
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions onmt/translate/beam_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,12 @@ def update_finished(self):

# reset the selection for the next step
self.select_indices = self._batch_index.view(_B_new * self.beam_size)
# assert torch.equal(
# self.src_len[self.select_indices],
# self.src_len.view(_B_old, self.beam_size)[non_finished].view(
# _B_new * self.beam_size
# ),
# )
self.src_len = self.src_len[self.select_indices]
self.maybe_update_target_prefix(self.select_indices)

Expand Down

0 comments on commit cbc7273

Please sign in to comment.