ac730aec61523031016afc8922c04bfc7a7ac42b,fairseq/sequence_generator.py,SequenceGenerator,_generate,#SequenceGenerator#Any#Any#Any#Any#,168

Before Change


                BeamContainer(elem["score"].item(), elem) for elem in finalized[sent]
            ]
            BCList.sort()
            BCList.reverse()
            finalized[sent] = torch.jit.annotate(
                List[Dict[str, Tensor]], [x.elem for x in BCList]
            )

After Change


        for sent in range(len(finalized)):
            scores = torch.tensor([float(elem["score"].item()) for elem in finalized[sent]])
            _, sorted_scores_indices = torch.sort(scores, descending=True)
            finalized[sent] = [finalized[sent][ssi] for ssi in sorted_scores_indices]
            finalized[sent] = torch.jit.annotate(List[Dict[str, Tensor]], finalized[sent])
        return finalized

    def _prefix_tokens(
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: pytorch/fairseq
Commit Name: ac730aec61523031016afc8922c04bfc7a7ac42b
Time: 2020-09-03
Author: juancarabina@fb.com
File Name: fairseq/sequence_generator.py
Class Name: SequenceGenerator
Method Name: _generate


Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 7359fd29a345057708ee611225dc01dd10273316
Time: 2017-09-07
Author: yutiansut@qq.com
File Name: QUANTAXIS/QABacktest/QABacktest.py
Class Name: QA_Backtest
Method Name: QA_backtest_sell_all


Project Name: codelucas/newspaper
Commit Name: 5d6cdbd53544d057a1cf344526ec70e0995b77d1
Time: 2014-12-17
Author: lucasyangpersonal@gmail.com
File Name: newspaper/nlp.py
Class Name:
Method Name: keywords