Skip to content

Commit

Permalink
Merge pull request #32 from ziangzhou-duke/bugfix
Browse files Browse the repository at this point in the history
change torch.div to torch.floor_divide @line81 for compatibility with higher version PyTorch
  • Loading branch information
Michaelvll committed Jun 11, 2021
2 parents e7288a7 + 54d5682 commit de9631c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fairseq/search.py
Expand Up @@ -78,7 +78,7 @@ def step(self, step, lprobs, scores):
),
out=(self.scores_buf, self.indices_buf),
)
torch.div(self.indices_buf, vocab_size, out=self.beams_buf)
torch.floor_divide(self.indices_buf, vocab_size, out=self.beams_buf)
self.indices_buf.fmod_(vocab_size)
return self.scores_buf, self.indices_buf, self.beams_buf

Expand Down

0 comments on commit de9631c

Please sign in to comment.