3a71ecffa3a8aff931a0ff865434e11e8ea08ba3,onmt/translate/translator.py,Translator,_fast_translate_batch,#Translator#Any#Any#Any#Any#Any#Any#,328

Before Change


                for i in range(is_finished.size(0)):
                    b = batch_offset[i]
                    if end_condition[i]:
                        is_finished[i].fill_(1)
                    finished_hyp = is_finished[i].nonzero().view(-1)
                    // Store finished hypotheses for this batch.
                    for j in finished_hyp:
                        hypotheses[b].append((

After Change


        memory_bank = tile(memory_bank, beam_size, dim=1)
        memory_lengths = tile(src_lengths, beam_size)

        top_beam_finished = torch.zeros([batch_size], dtype=torch.uint8)
        batch_offset = torch.arange(batch_size, dtype=torch.long)
        beam_offset = torch.arange(
            0,
            batch_size * beam_size,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: OpenNMT/OpenNMT-py
Commit Name: 3a71ecffa3a8aff931a0ff865434e11e8ea08ba3
Time: 2018-10-22
Author: guillaume.klein@systrangroup.com
File Name: onmt/translate/translator.py
Class Name: Translator
Method Name: _fast_translate_batch


Project Name: rusty1s/pytorch_geometric
Commit Name: 96e491ca86bdb946585f5ae25bb80622b49cd59e
Time: 2017-11-20
Author: matthias.fey@tu-dortmund.de
File Name: examples/cora.py
Class Name:
Method Name:


Project Name: jadore801120/attention-is-all-you-need-pytorch
Commit Name: ac16b752e6f3698c2c6ba4c4f581d490526519ef
Time: 2018-08-25
Author: yhhuang@nlg.csie.ntu.edu.tw
File Name: transformer/Beam.py
Class Name: Beam
Method Name: __init__