ceda7ee4c7659a3fc19cfb7cba53533edbb98a4a,onmt/tests/test_beam_search.py,TestBeamSearch,test_advance_with_all_repeats_gets_blocked,#TestBeamSearch#,30
Before Change
[0] + [-float("inf")] * (beam_sz - 1))\
.repeat(batch_sz, 1)
expected_scores[:, :] = self.BLOCKED_SCORE
expected_scores = torch.tensor(
self.BLOCKED_SCORE).repeat(batch_sz, beam_sz)
def test_advance_with_some_repeats_gets_blocked(self):
// beam 0 and beam >=2 will repeat (beam >= 2 repeat dummy scores)
beam_sz = 5
After Change
expected_scores = torch.tensor(
[self.BLOCKED_SCORE] + [-float("inf")] * (beam_sz - 1)
).repeat(batch_sz, 1)
self.assertTrue(beam.topk_log_probs.equal(expected_scores))
def test_advance_with_some_repeats_gets_blocked(self):
// beam 0 and beam >=2 will repeat (beam >= 2 repeat dummy scores)
beam_sz = 5
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 3
Instances
Project Name: OpenNMT/OpenNMT-py
Commit Name: ceda7ee4c7659a3fc19cfb7cba53533edbb98a4a
Time: 2020-09-02
Author: pltrdy@gmail.com
File Name: onmt/tests/test_beam_search.py
Class Name: TestBeamSearch
Method Name: test_advance_with_all_repeats_gets_blocked
Project Name: tensorflow/mesh
Commit Name: 5b1c7920c21005c50c84c06b0677e8ae348ce8f7
Time: 2019-05-19
Author: no-reply@google.com
File Name: mesh_tensorflow/transformer/dataset.py
Class Name:
Method Name: packed_parallel_tsv_dataset
Project Name: pytorch/audio
Commit Name: 3047dc9b500266d8197139fad5ef3a8a4a459985
Time: 2021-02-28
Author: toastedjcaw@gmail.com
File Name: test/torchaudio_unittest/functional/batch_consistency_test.py
Class Name: TestFunctional
Method Name: assert_batch_consistency
Project Name: PyMVPA/PyMVPA
Commit Name: eb4950c06f23adcbd73cb635fba86bac56276deb
Time: 2014-02-26
Author: michael.hanke@gmail.com
File Name: mvpa2/tests/test_rsa.py
Class Name:
Method Name: test_DissimilarityConsistencyMeasure