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
7f7967b3
You need to sign in or sign up before continuing.
Unverified
Commit
7f7967b3
authored
Feb 08, 2024
by
Rhett Ying
Committed by
GitHub
Feb 08, 2024
Browse files
[doc] fix undefined variable in example
parent
763bd39f
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 @
7f7967b3
...
@@ -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
.
...
...
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