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

Before Change


    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

After Change


    else:
        device = th.device("cpu")

    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)
    in_feats = g.ndata["features"].shape[1]
    train_mask = g.ndata["train_mask"]
    val_mask = g.ndata["val_mask"]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

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: elbayadm/attn2d
Commit Name: e6422528dae0b899848469efe2dc404c1e639ce9
Time: 2019-03-15
Author: myleott@fb.com
File Name: fairseq/modules/adaptive_softmax.py
Class Name: AdaptiveSoftmax
Method Name: upgrade_state_dict_named