9ea14875825b2ab63a43ad2f0f5159d99df86d02,model.py,Lookahead,forward,#Lookahead#Any#,122

Before Change


        seq_len = input.size(0)
        // pad the 0th dimension (T/sequence) with zeroes whose number = context
        // Once pytorch"s padding functions have settled, should move to those.
        padding = torch.zeros(self.context, *(input.size()[1:])).type_as(input)
        x = torch.cat((input, padding), 0)

        // add lookahead windows (with context+1 width) as a fourth dimension
        // for each seq-batch-feature combination
        x = [x[i:i + self.context + 1] for i in range(seq_len)]  // TxLxNxH - sequence, context, batch, feature
        x = torch.stack(x)
        x = x.permute(0, 2, 3, 1)  // TxNxHxL - sequence, batch, feature, context

After Change


                              groups=self.n_features, padding=0, bias=None)

    def forward(self, x):
        x = x.transpose(0, 1).transpose(1, 2)
        x = F.pad(x, pad=self.pad, value=0)
        x = self.conv(x)
        x = x.transpose(1, 2).transpose(0, 1).contiguous()
        return x

    def __repr__(self):
        return self.__class__.__name__ + "(" \
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: SeanNaren/deepspeech.pytorch
Commit Name: 9ea14875825b2ab63a43ad2f0f5159d99df86d02
Time: 2019-07-29
Author: rasmus.arpe@gmail.com
File Name: model.py
Class Name: Lookahead
Method Name: forward


Project Name: jacobgil/pytorch-grad-cam
Commit Name: 5890d98d650b9bf3c1824f48fec96ad90c94fbbb
Time: 2020-01-11
Author: jacob.gildenblat@gmail.com
File Name: grad-cam.py
Class Name:
Method Name:


Project Name: cornellius-gp/gpytorch
Commit Name: 3879bcde8d42c619c96b6483dba14a76a8e5f00b
Time: 2019-09-29
Author: kaw293@cornell.edu
File Name: gpytorch/utils/grid.py
Class Name:
Method Name: create_data_from_grid