Skip to content

Commit

Permalink
[doc] fix undefined variable in example
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhett-Ying authored Feb 8, 2024
1 parent 763bd39 commit 7f7967b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/source/guide/minibatch-node.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ putting the list of generated MFGs onto GPU.
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
dataset = gb.BuiltinDataset("ogbn-arxiv").load()
g = dataset.graph
feature = dataset.feature
train_set = dataset.tasks[0].train_set
datapipe = gb.ItemSampler(train_set, batch_size=1024, shuffle=True)
datapipe = datapipe.sample_neighbor(g, [10, 10]) # 2 layers.
Expand Down Expand Up @@ -207,6 +208,7 @@ of node types to node IDs.
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
dataset = gb.BuiltinDataset("ogbn-mag").load()
g = dataset.graph
feature = dataset.feature
train_set = dataset.tasks[0].train_set
datapipe = gb.ItemSampler(train_set, batch_size=1024, shuffle=True)
datapipe = datapipe.sample_neighbor(g, [10, 10]) # 2 layers.
Expand Down

0 comments on commit 7f7967b

Please sign in to comment.