Unverified Commit 7f7967b3 authored by Rhett Ying's avatar Rhett Ying Committed by GitHub
Browse files

[doc] fix undefined variable in example

parent 763bd39f
...@@ -45,6 +45,7 @@ putting the list of generated MFGs onto GPU. ...@@ -45,6 +45,7 @@ putting the list of generated MFGs onto GPU.
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
dataset = gb.BuiltinDataset("ogbn-arxiv").load() dataset = gb.BuiltinDataset("ogbn-arxiv").load()
g = dataset.graph g = dataset.graph
feature = dataset.feature
train_set = dataset.tasks[0].train_set train_set = dataset.tasks[0].train_set
datapipe = gb.ItemSampler(train_set, batch_size=1024, shuffle=True) datapipe = gb.ItemSampler(train_set, batch_size=1024, shuffle=True)
datapipe = datapipe.sample_neighbor(g, [10, 10]) # 2 layers. datapipe = datapipe.sample_neighbor(g, [10, 10]) # 2 layers.
...@@ -207,6 +208,7 @@ of node types to node IDs. ...@@ -207,6 +208,7 @@ of node types to node IDs.
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
dataset = gb.BuiltinDataset("ogbn-mag").load() dataset = gb.BuiltinDataset("ogbn-mag").load()
g = dataset.graph g = dataset.graph
feature = dataset.feature
train_set = dataset.tasks[0].train_set train_set = dataset.tasks[0].train_set
datapipe = gb.ItemSampler(train_set, batch_size=1024, shuffle=True) datapipe = gb.ItemSampler(train_set, batch_size=1024, shuffle=True)
datapipe = datapipe.sample_neighbor(g, [10, 10]) # 2 layers. datapipe = datapipe.sample_neighbor(g, [10, 10]) # 2 layers.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment