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
5a7e156f
Unverified
Commit
5a7e156f
authored
Sep 23, 2023
by
czkkkkkk
Committed by
GitHub
Sep 23, 2023
Browse files
[Example] Fix label dtype error in multigpu node classification. (#6376)
parent
d912947b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
examples/multigpu/node_classification_sage.py
examples/multigpu/node_classification_sage.py
+1
-1
No files found.
examples/multigpu/node_classification_sage.py
View file @
5a7e156f
...
@@ -204,7 +204,7 @@ def train(
...
@@ -204,7 +204,7 @@ def train(
train_dataloader
train_dataloader
):
):
x
=
blocks
[
0
].
srcdata
[
"feat"
]
x
=
blocks
[
0
].
srcdata
[
"feat"
]
y
=
blocks
[
-
1
].
dstdata
[
"label"
]
y
=
blocks
[
-
1
].
dstdata
[
"label"
]
.
to
(
torch
.
int64
)
y_hat
=
model
(
blocks
,
x
)
y_hat
=
model
(
blocks
,
x
)
loss
=
F
.
cross_entropy
(
y_hat
,
y
)
loss
=
F
.
cross_entropy
(
y_hat
,
y
)
opt
.
zero_grad
()
opt
.
zero_grad
()
...
...
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