a27d95173d560a536480ef86ce18640bb6ee95b8,torch_geometric/utils/softmax.py,,softmax,#Any#Any#Any#Any#,9

Before Change


    :rtype: :class:`Tensor`
    
    out = src
    if src.numel() > 0:
        out = out - src.max()
    out = out.exp()

    if ptr is not None:
        out_sum = gather_csr(segment_csr(out, ptr, reduce="sum"), ptr)

After Change


    :rtype: :class:`Tensor`
    
    if ptr is not None:
        src_max = gather_csr(segment_csr(src, ptr, reduce="max"), ptr)
        out = (src - src_max).exp()
        out_sum = gather_csr(segment_csr(out, ptr, reduce="sum"), ptr)
    elif index is not None:
        N = maybe_num_nodes(index, num_nodes)
        src_max = scatter(src, index, dim=0, dim_size=N, reduce="max")[index]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: rusty1s/pytorch_geometric
Commit Name: a27d95173d560a536480ef86ce18640bb6ee95b8
Time: 2021-01-14
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/utils/softmax.py
Class Name:
Method Name: softmax


Project Name: rusty1s/pytorch_geometric
Commit Name: f0f4b54881ba31bfdd8ab6178539e861d5b1ccde
Time: 2020-05-31
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/nn/conv/gravnet_conv.py
Class Name: GravNetConv
Method Name: aggregate


Project Name: rusty1s/pytorch_geometric
Commit Name: 9f4bcf25821b115fbd25e31165b91bdd6f22dcbe
Time: 2020-04-06
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/nn/conv/gravnet_conv.py
Class Name: GravNetConv
Method Name: aggregate