31e7f40c3381aac21e8665d0b5706bceddd9de94,onmt/Models.py,Decoder,forward,#Decoder#Any#Any#Any#Any#Any#,334

Before Change


        emb = self.word_lut(input)
        if self.positional_encoding:
            emb = emb + Variable(self.pe[:emb.size(0), :1, :emb.size(2)].expand_as(emb))
            emb = emb * math.sqrt(emb.size(2))
            
        // n.b. you can increase performance if you compute W_ih * x for all
        // iterations in parallel, but that"s only possible if
        // self.input_feed=False

After Change


            if False:
                if hidden:
                    outputs = outputs[hidden.size(0):]
                    attn = attn[:, hidden.size(0):].squeeze()
                    attn = torch.stack([attn])
                
            attns["std"] = attn
            if self._copy:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: OpenNMT/OpenNMT-py
Commit Name: 31e7f40c3381aac21e8665d0b5706bceddd9de94
Time: 2017-06-25
Author: srush@sum1gpu01.rc.fas.harvard.edu
File Name: onmt/Models.py
Class Name: Decoder
Method Name: forward


Project Name: maciejkula/spotlight
Commit Name: 70e4d7fe60a9658bb27b9f5fb67592a1222b2ec3
Time: 2017-07-06
Author: maciej.kula@gmail.com
File Name: spotlight/sequence/representations.py
Class Name: CNNNet
Method Name: user_representation


Project Name: maciejkula/spotlight
Commit Name: 70e4d7fe60a9658bb27b9f5fb67592a1222b2ec3
Time: 2017-07-06
Author: maciej.kula@gmail.com
File Name: spotlight/sequence/representations.py
Class Name: PoolNet
Method Name: user_representation