02d3197407487646dc5ca6abd889b8fe5fed1aef,examples/pytorch/graphsage/train_sampling.py,,,#,223

Before Change


        device = th.device("cpu")

    // load reddit data
    data = RedditDataset(self_loop=True)
    train_mask = data.train_mask
    val_mask = data.val_mask
    features = th.Tensor(data.features)
    in_feats = features.shape[1]
    labels = th.LongTensor(data.labels)
    n_classes = data.num_labels
    // Construct graph
    g = dgl.graph(data.graph.all_edges())
    g.ndata["features"] = features
    prepare_mp(g)
    // Pack data
    data = train_mask, val_mask, in_feats, labels, n_classes, g

After Change


    if args.dataset == "reddit":
        g, n_classes = load_reddit()
    elif args.dataset == "ogb-product":
        g, n_classes = load_ogb("ogbn-products")
    else:
        raise Exception("unknown dataset")
    g = dgl.as_heterograph(g)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 20

Instances


Project Name: dmlc/dgl
Commit Name: 02d3197407487646dc5ca6abd889b8fe5fed1aef
Time: 2020-06-27
Author: zhengda1936@gmail.com
File Name: examples/pytorch/graphsage/train_sampling.py
Class Name:
Method Name:


Project Name: dmlc/dgl
Commit Name: 02d3197407487646dc5ca6abd889b8fe5fed1aef
Time: 2020-06-27
Author: zhengda1936@gmail.com
File Name: examples/pytorch/graphsage/train_sampling.py
Class Name:
Method Name:


Project Name: dmlc/dgl
Commit Name: 4ddd477f356d51d87763a5b27c8948f007691a50
Time: 2020-07-02
Author: coin2028@hotmail.com
File Name: examples/pytorch/graphsage/train_sampling_multi_gpu.py
Class Name:
Method Name:


Project Name: lanpa/tensorboardX
Commit Name: 6fe9fb323ba3292fb427173095f99669f832d836
Time: 2018-11-09
Author: huang.dexter@gmail.com
File Name: examples/demo_graph.py
Class Name:
Method Name: