5ffa38fca42bb3fbee030f4b80264e0f4910a49c,torch_geometric/datasets/utils/tu_format.py,,read_adj,#Any#Any#,15

Before Change


    new_index = index.new(index.size()).copy_(index)

    indicator = read_file(dir, prefix, "graph_indicator").long() - 1
    bincount = torch.from_numpy(np.bincount(indicator.numpy()))

    index_slice = index.new(bincount.size(0) + 1)
    index_slice[0] = 0
    curr_graph = indicator[0]
    for i in range(index.size(1)):
        row = index[0, i]
        if indicator[row] > curr_graph:
            new_index[:, i:] -= bincount[curr_graph]
            curr_graph += 1
            index_slice[curr_graph] = i
    index_slice[-1] = index.size(1)
    index = new_index

After Change


    for i in range(index.size(1)):
        row = index[0, i]
        if indicator[row] > curr_graph:
            index[:, index_slice[curr_graph]:i] -= index[:, index_slice[curr_graph]:i].min()
            curr_graph += 1
            index_slice[curr_graph] = i
    index[:, index_slice[curr_graph]:] -= index[:, index_slice[curr_graph]:].min()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: rusty1s/pytorch_geometric
Commit Name: 5ffa38fca42bb3fbee030f4b80264e0f4910a49c
Time: 2018-01-16
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/datasets/utils/tu_format.py
Class Name:
Method Name: read_adj


Project Name: SpiNNakerManchester/sPyNNaker
Commit Name: 32e8a85f4e3e2cd914e438f5ee8b2316bbc3572e
Time: 2018-07-10
Author: andrew.gait@manchester.ac.uk
File Name: spynnaker/pyNN/models/neural_projections/connectors/array_connector.py
Class Name: ArrayConnector
Method Name: get_n_connections_from_pre_vertex_maximum


Project Name: scipy/scipy
Commit Name: 2a28ba889d85c28e490b8b99aef8909e4602aff5
Time: 2019-06-30
Author: rlucas7@vt.edu
File Name: scipy/stats/_binned_statistic.py
Class Name:
Method Name: binned_statistic_dd