7685a96e027fbec01ec11847e1a0e8e4a6040ee6,onmt/tests/test_beam_search.py,TestBeamSearch,test_advance_with_all_repeats_gets_blocked,#TestBeamSearch#,31

Before Change


        for batch_sz in [1, 3]:
            beam = BeamSearch(
                beam_sz, batch_sz, 0, 1, 2, 2,
                torch.device("cpu"), GlobalScorerStub(), 0, 30,
                False, ngram_repeat, set(),
                torch.randint(0, 30, (batch_sz,)), False, 0.)
            for i in range(ngram_repeat + 4):
                // predict repeat_idx over and over again
                word_probs = torch.full(

After Change


        n_words = 100
        repeat_idx = 47
        ngram_repeat = 3
        device_init = torch.zeros(1, 1)
        for batch_sz in [1, 3]:
            beam = BeamSearch(
                beam_sz, batch_sz, 0, 1, 2, 2,
                GlobalScorerStub(), 0, 30,
                False, ngram_repeat, set(),
                False, 0.)
            beam.initialize(device_init, torch.randint(0, 30, (batch_sz,)))
            for i in range(ngram_repeat + 4):
                // predict repeat_idx over and over again
                word_probs = torch.full(
                    (batch_sz * beam_sz, n_words), -float("inf"))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 6

Non-data size: 6

Instances


Project Name: OpenNMT/OpenNMT-py
Commit Name: 7685a96e027fbec01ec11847e1a0e8e4a6040ee6
Time: 2019-11-20
Author: 419344739@qq.com
File Name: onmt/tests/test_beam_search.py
Class Name: TestBeamSearch
Method Name: test_advance_with_all_repeats_gets_blocked


Project Name: OpenNMT/OpenNMT-py
Commit Name: 7685a96e027fbec01ec11847e1a0e8e4a6040ee6
Time: 2019-11-20
Author: 419344739@qq.com
File Name: onmt/tests/test_beam_search.py
Class Name: TestBeamSearch
Method Name: test_repeating_excluded_index_does_not_die


Project Name: OpenNMT/OpenNMT-py
Commit Name: 7685a96e027fbec01ec11847e1a0e8e4a6040ee6
Time: 2019-11-20
Author: 419344739@qq.com
File Name: onmt/tests/test_beam_search.py
Class Name: TestBeamSearch
Method Name: test_advance_with_some_repeats_gets_blocked


Project Name: OpenNMT/OpenNMT-py
Commit Name: 7685a96e027fbec01ec11847e1a0e8e4a6040ee6
Time: 2019-11-20
Author: 419344739@qq.com
File Name: onmt/tests/test_beam_search.py
Class Name: TestBeamWithLengthPenalty
Method Name: test_beam_advance_against_known_reference


Project Name: OpenNMT/OpenNMT-py
Commit Name: 7685a96e027fbec01ec11847e1a0e8e4a6040ee6
Time: 2019-11-20
Author: 419344739@qq.com
File Name: onmt/tests/test_beam_search.py
Class Name: TestBeamSearchAgainstReferenceCase
Method Name: test_beam_advance_against_known_reference


Project Name: OpenNMT/OpenNMT-py
Commit Name: 7685a96e027fbec01ec11847e1a0e8e4a6040ee6
Time: 2019-11-20
Author: 419344739@qq.com
File Name: onmt/tests/test_beam_search.py
Class Name: TestBeamSearch
Method Name: test_beam_is_done_when_n_best_beams_eos_using_min_length