Unverified Commit e0cd39d6 authored by Julia Kreutzer's avatar Julia Kreutzer Committed by GitHub
Browse files

Merge pull request #105 from CateGitau/my_branch

changed torch's .div() to .floor_divide()
parents 2e3b1536 6896c50a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -321,7 +321,7 @@ def beam_search(
            topk_log_probs = topk_scores.clone()

        # reconstruct beam origin and true word ids from flattened order
        topk_beam_index = topk_ids.div(decoder.output_size)
        topk_beam_index = topk_ids.floor_divide(decoder.output_size)
        topk_ids = topk_ids.fmod(decoder.output_size)

        # map beam_index to batch_index in the flat representation