b48c943b9f6248dbdd42d0fce44658b937098372,torch_geometric/nn/functional/spline_gcn.py,,spline_gcn,#Any#Any#Any#Any#Any#Any#Any#,9

Before Change



    // Convolution via sparse row sum. Converts [|E| x M_out] feature matrix to
    // [n x M_out] feature matrix.
    size = torch.Size([adj.size(0), adj.size(1), output.size(1)])
    adj = torch.sparse.FloatTensor(indices, output, size)
    output = sum(adj, dim=1)

    // TODO: root node and weight mean
    // root_weight = weight[torch.arange(kernel_size[-1])]
    // root_weight.mean(0)

After Change



    // Convolution via `scatter_add`. Converts [|E| x M_out] feature matrix to
    // [n x M_out] feature matrix.
    zero = torch.zeros(adj.size(1), output.size(1))
    zero = zero.cuda() if output.is_cuda else zero
    zero = Variable(zero) if not torch.is_tensor(output) else zero
    row = row.view(-1, 1).expand(row.size(0), output.size(1))
    output = zero.scatter_add_(0, row, output)

    // Weighten root node features by multiplying with the meaned weights at the
    // origin.
    index = torch.arange(0, kernel_size[-1]).long()
    root_weight = weight[index].mean(0)
    output += torch.mm(features, root_weight)

    if bias is not None:
        output += bias
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 6

Instances


Project Name: rusty1s/pytorch_geometric
Commit Name: b48c943b9f6248dbdd42d0fce44658b937098372
Time: 2017-10-23
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/nn/functional/spline_gcn.py
Class Name:
Method Name: spline_gcn


Project Name: r9y9/deepvoice3_pytorch
Commit Name: 96ecbdba66058274e2ceb9f58261daa4a45eb873
Time: 2019-12-21
Author: zryuichi@gmail.com
File Name: deepvoice3_pytorch/modules.py
Class Name:
Method Name: get_mask_from_lengths


Project Name: elbayadm/attn2d
Commit Name: 3dcb5c77165c1a0c33a35a7831182f1aa2e8ad73
Time: 2019-10-18
Author: changhan@fb.com
File Name: fairseq/models/model_utils.py
Class Name:
Method Name: fill_tensors


Project Name: stanfordnlp/stanza
Commit Name: fcea9fee573e854177b4b9af1cfd1b20029ed21e
Time: 2018-10-11
Author: qipeng@users.noreply.github.com
File Name: models/common/char_model.py
Class Name: CharacterModel
Method Name: forward