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

Before Change


                            results["predictions"][b].append(pred)
                            results["attention"][b].append(
                                attn if attn is not None else [])
                non_finished = end_condition.eq(0).nonzero().view(-1)
                // If all sentences are translated, no need to go further.
                if len(non_finished) == 0:
                    break
                // Remove finished batches for the next step.

After Change


                            if attention is not None else None))
                    // End condition is the top beam finished and we can return
                    // n_best hypotheses.
                    if top_beam_finished[i] and len(hypotheses[b]) >= n_best:
                        best_hyp = sorted(
                            hypotheses[b], key=lambda x: x[0], reverse=True)
                        for n, (score, pred, attn) in enumerate(best_hyp):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

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: ikostrikov/pytorch-a2c-ppo-acktr
Commit Name: 5dba182362d6d3b7d87fe852a4d707bd7ec3153a
Time: 2017-11-17
Author: ikostrikov@gmail.com
File Name: main.py
Class Name:
Method Name: main


Project Name: dmlc/dgl
Commit Name: 9a0511c8e91a7f633c9c3292fccbcbad5281d1f5
Time: 2019-11-03
Author: expye@outlook.com
File Name: python/dgl/nn/pytorch/conv/gatedgraphconv.py
Class Name: GatedGraphConv
Method Name: forward