dccf79092eb28fa7b176945b6c01906a261522f2,fairseq/sequence_generator.py,SequenceGenerator,_decode,#SequenceGenerator#Any#Any#,321

Before Change


            attn = attn[:, -1, :].data
            if avg_probs is None or avg_attn is None:
                avg_probs = probs
                avg_attn = attn
            else:
                avg_probs.add_(probs)
                avg_attn.add_(attn)
        avg_probs.div_(len(self.models))
        avg_probs.log_()
        avg_attn.div_(len(self.models))

After Change


                avg_probs.add_(probs)
            if attn is not None:
                attn = attn[:, -1, :].data
                if avg_attn is None:
                    avg_attn = attn
                else:
                    avg_attn.add_(attn)
        avg_probs.div_(len(self.models))
        avg_probs.log_()
        if avg_attn is not None:
            avg_attn.div_(len(self.models))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: elbayadm/attn2d
Commit Name: dccf79092eb28fa7b176945b6c01906a261522f2
Time: 2018-01-22
Author: myleott@fb.com
File Name: fairseq/sequence_generator.py
Class Name: SequenceGenerator
Method Name: _decode


Project Name: cornellius-gp/gpytorch
Commit Name: a1e8bcc26a4b432776620b242023adb7acf206e3
Time: 2019-01-27
Author: gardner.jake@gmail.com
File Name: gpytorch/utils/linear_cg.py
Class Name:
Method Name: linear_cg


Project Name: cornellius-gp/gpytorch
Commit Name: 86ac9b94f772382087b4f92ebe0625173dfa314c
Time: 2019-01-23
Author: gardner.jake@gmail.com
File Name: gpytorch/utils/linear_cg.py
Class Name:
Method Name: linear_cg