e0f0cf7deb155eff91c306e6ca181c6f9c5ada7d,torch_geometric/nn/conv/nn_conv.py,NNConv,forward,#NNConv#Any#Any#Any#,66

Before Change


    def forward(self, x, edge_index, pseudo):
        
        x = x.unsqueeze(-1) if x.dim() == 1 else x
        pseudo = pseudo.unsqueeze(-1) if pseudo.dim() == 1 else pseudo
        row, col = edge_index

        out = self.nn(pseudo)
        out = out.view(-1, self.in_channels, self.out_channels)
        out = torch.matmul(x[col].unsqueeze(1), out).squeeze(1)
        out = scatter_(self.aggr, out, row, dim_size=x.size(0))

        if self.root is not None:
            out = out + torch.mm(x, self.root)

        if self.bias is not None:
            out = out + self.bias

        return out

    def __repr__(self):
        return "{}({}, {})".format(self.__class__.__name__, self.in_channels,
                                   self.out_channels)

After Change


        
        x = x.unsqueeze(-1) if x.dim() == 1 else x
        pseudo = edge_attr.unsqueeze(-1) if edge_attr.dim() == 1 else edge_attr
        return self.propagate(edge_index, x=x, pseudo=pseudo)

    def message(self, x_j, pseudo):
        weight = self.nn(pseudo).view(-1, self.in_channels, self.out_channels)
        return torch.matmul(x_j.unsqueeze(1), weight).squeeze(1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 7

Instances


Project Name: rusty1s/pytorch_geometric
Commit Name: e0f0cf7deb155eff91c306e6ca181c6f9c5ada7d
Time: 2019-04-22
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/nn/conv/nn_conv.py
Class Name: NNConv
Method Name: forward


Project Name: cornellius-gp/gpytorch
Commit Name: e712d42833a82df3331d1e742ed95b0e7dc235fb
Time: 2018-01-31
Author: gpleiss@gmail.com
File Name: gpytorch/random_variables/gaussian_random_variable.py
Class Name: GaussianRandomVariable
Method Name: sample


Project Name: uber/pyro
Commit Name: cce694178ae66b3a84623d517ffdf0c1bb32ba27
Time: 2020-05-11
Author: fehiepsi@gmail.com
File Name: pyro/infer/mcmc/hmc.py
Class Name: HMC
Method Name: _kinetic_energy


Project Name: uber/ludwig
Commit Name: 2950d48e53aa9a3e026894f39be8f50fe47de01d
Time: 2020-04-17
Author: jimthompson5802@gmail.com
File Name: ludwig/models/modules/sequence_decoders.py
Class Name: SequenceTaggerDecoder
Method Name: call