Skip to content

Commit

Permalink
fix contiguous issue with dec_bos_cut
Browse files Browse the repository at this point in the history
  • Loading branch information
thammegowda committed Aug 21, 2020
1 parent 19c56bb commit 0478060
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rtg/module/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def beam_decode(self, x_seqs, x_lens, max_len, beam_size=default_beam_size, num_
if actives.sum() == 0: # all sequences Ended
break
# [Batch x Beams x Vocab] <-- [Batch x Beams x Time]
flat_ys = ys.view(batch_size * beam_size, -1)
flat_ys = ys.contiguous().view(batch_size * beam_size, -1)
log_prob = gen.generate_next(flat_ys) # ys upto current time step
log_prob = log_prob.view(batch_size, beam_size, -1)

Expand Down

0 comments on commit 0478060

Please sign in to comment.