Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
870d8d02
Unverified
Commit
870d8d02
authored
Feb 08, 2024
by
Rhett Ying
Committed by
GitHub
Feb 08, 2024
Browse files
[doc] fix undefined variable in code snippet (#7107)
parent
8cf5ad84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
docs/source/guide/minibatch-node.rst
docs/source/guide/minibatch-node.rst
+2
-0
No files found.
docs/source/guide/minibatch-node.rst
View file @
870d8d02
...
@@ -44,6 +44,7 @@ putting the list of generated MFGs onto GPU.
...
@@ -44,6 +44,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
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
.
...
@@ -205,6 +206,7 @@ of node types to node IDs.
...
@@ -205,6 +206,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
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
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment