a998e7a1fa996edb4bcc1b34a0df5967ed6ec9e2,torch_geometric/utils/convert.py,,to_networkx,#Any#Any#Any#Any#Any#,53

Before Change


        G = nx.DiGraph()

    G.add_nodes_from(range(data.num_nodes))
    values = {key: data[key].squeeze().tolist() for key in data.keys}

    for i, (u, v) in enumerate(data.edge_index.t().tolist()):

After Change


    G.add_nodes_from(range(data.num_nodes))

    values = {}
    for key, item in data:
        if torch.is_tensor(item):
            values[key] = item.squeeze().tolist()
        else:
            values[key] = item
        if isinstance(values[key], (list, tuple)) and len(values[key]) == 1:
            values[key] = item[0]

    for i, (u, v) in enumerate(data.edge_index.t().tolist()):

        if to_undirected and v > u:
            continue
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: rusty1s/pytorch_geometric
Commit Name: a998e7a1fa996edb4bcc1b34a0df5967ed6ec9e2
Time: 2020-05-13
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/utils/convert.py
Class Name:
Method Name: to_networkx


Project Name: rusty1s/pytorch_geometric
Commit Name: 675b7884c09875486fdddffa2d8a6a12247ab4d7
Time: 2020-05-31
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/utils/convert.py
Class Name:
Method Name: to_networkx


Project Name: dmlc/dgl
Commit Name: 25ac33440334fd2fdfe3fe4e4dd3dd1428601a47
Time: 2021-01-24
Author: zhengda1936@gmail.com
File Name: python/dgl/distributed/graph_services.py
Class Name:
Method Name: sample_neighbors