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
apex
Commits
90e5b05a
Commit
90e5b05a
authored
Jun 20, 2019
by
Michael Carilli
Browse files
Fix end-of-epoch with record_stream
parent
1ccaaf4a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
examples/imagenet/main_amp.py
examples/imagenet/main_amp.py
+4
-2
No files found.
examples/imagenet/main_amp.py
View file @
90e5b05a
...
@@ -300,8 +300,10 @@ class data_prefetcher():
...
@@ -300,8 +300,10 @@ class data_prefetcher():
torch
.
cuda
.
current_stream
().
wait_stream
(
self
.
stream
)
torch
.
cuda
.
current_stream
().
wait_stream
(
self
.
stream
)
input
=
self
.
next_input
input
=
self
.
next_input
target
=
self
.
next_target
target
=
self
.
next_target
input
.
record_stream
(
torch
.
cuda
.
current_stream
())
if
input
is
not
None
:
target
.
record_stream
(
torch
.
cuda
.
current_stream
())
input
.
record_stream
(
torch
.
cuda
.
current_stream
())
if
target
is
not
None
:
target
.
record_stream
(
torch
.
cuda
.
current_stream
())
self
.
preload
()
self
.
preload
()
return
input
,
target
return
input
,
target
...
...
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