Skip to content

Commit fad3cf0

Browse files
Mike Ruberryfacebook-github-bot
authored andcommitted
Updates floor division to use floor division operator
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
1 parent 1e40a48 commit fad3cf0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fairseq/search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def step(self, step: int, lprobs, scores):
335335
k,
336336
)
337337

338-
final_beams = torch.div(final_indices, k)
338+
final_beams = final_indices // k
339339

340340
for i in range(bsz):
341341
final_indices[i] = indices[i][final_indices[i]]

0 commit comments

Comments
 (0)