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
ee91863e
Unverified
Commit
ee91863e
authored
Jul 28, 2022
by
Wey Gu
Committed by
GitHub
Jul 28, 2022
Browse files
[Example] Fixed device type in GraphSAGE inference (#4306)
* Fixed device type in inference * change buffer_device instead
parent
2cf05c53
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
examples/pytorch/graphsage/node_classification.py
examples/pytorch/graphsage/node_classification.py
+1
-1
No files found.
examples/pytorch/graphsage/node_classification.py
View file @
ee91863e
...
@@ -39,7 +39,7 @@ class SAGE(nn.Module):
...
@@ -39,7 +39,7 @@ class SAGE(nn.Module):
g
,
torch
.
arange
(
g
.
num_nodes
()).
to
(
g
.
device
),
sampler
,
device
=
device
,
g
,
torch
.
arange
(
g
.
num_nodes
()).
to
(
g
.
device
),
sampler
,
device
=
device
,
batch_size
=
batch_size
,
shuffle
=
False
,
drop_last
=
False
,
batch_size
=
batch_size
,
shuffle
=
False
,
drop_last
=
False
,
num_workers
=
0
)
num_workers
=
0
)
buffer_device
=
'cpu'
buffer_device
=
torch
.
device
(
'cpu'
)
pin_memory
=
(
buffer_device
!=
device
)
pin_memory
=
(
buffer_device
!=
device
)
for
l
,
layer
in
enumerate
(
self
.
layers
):
for
l
,
layer
in
enumerate
(
self
.
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