Skip to content

Commit

Permalink
Updates floor division to use floor division operator
Browse files Browse the repository at this point in the history
Summary:
Performing floor division with torch.div is deprecated and will soon throw a runtime error. This diff updates the floor division to use the floor division operator.

Created from Diffusion's 'Open in Editor' feature.

Reviewed By: myleott

Differential Revision: D21848480

fbshipit-source-id: c9374e9406f4ba388f30315294eee7a2a4fcfecc
  • Loading branch information
Mike Ruberry authored and facebook-github-bot committed Jun 3, 2020
1 parent 1e40a48 commit fad3cf0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fairseq/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def step(self, step: int, lprobs, scores):
k,
)

final_beams = torch.div(final_indices, k)
final_beams = final_indices // k

for i in range(bsz):
final_indices[i] = indices[i][final_indices[i]]
Expand Down

0 comments on commit fad3cf0

Please sign in to comment.