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
6de7d5fa
Unverified
Commit
6de7d5fa
authored
May 20, 2022
by
Hao Yuan
Committed by
GitHub
May 20, 2022
Browse files
[Bugfix] Fix conditional judgment of cuda (#4026) (#4027)
parent
4b87e47f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
examples/pytorch/gat/train.py
examples/pytorch/gat/train.py
+4
-2
No files found.
examples/pytorch/gat/train.py
View file @
6de7d5fa
...
...
@@ -107,6 +107,7 @@ def main(args):
for
epoch
in
range
(
args
.
epochs
):
model
.
train
()
if
epoch
>=
3
:
if
cuda
:
torch
.
cuda
.
synchronize
()
t0
=
time
.
time
()
# forward
...
...
@@ -118,6 +119,7 @@ def main(args):
optimizer
.
step
()
if
epoch
>=
3
:
if
cuda
:
torch
.
cuda
.
synchronize
()
dur
.
append
(
time
.
time
()
-
t0
)
...
...
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