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
5ae6008d
Commit
5ae6008d
authored
Apr 15, 2019
by
Michael Carilli
Browse files
For testing purposes, enable the case where FusedAdam is not wrapped by amp
parent
53fd093d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
apex/optimizers/fused_adam.py
apex/optimizers/fused_adam.py
+5
-4
No files found.
apex/optimizers/fused_adam.py
View file @
5ae6008d
...
@@ -78,10 +78,11 @@ class FusedAdam(torch.optim.Optimizer):
...
@@ -78,10 +78,11 @@ class FusedAdam(torch.optim.Optimizer):
if
closure
is
not
None
:
if
closure
is
not
None
:
loss
=
closure
()
loss
=
closure
()
grads
=
self
.
_amp_stash
.
grads
if
hasattr
(
self
,
"_amp_stash"
):
output_params
=
self
.
_amp_stash
.
output_params
grads
=
self
.
_amp_stash
.
grads
scale
=
self
.
_amp_stash
.
scale
output_params
=
self
.
_amp_stash
.
output_params
grad_norms
=
self
.
_amp_stash
.
grad_norms
scale
=
self
.
_amp_stash
.
scale
grad_norms
=
self
.
_amp_stash
.
grad_norms
if
grads
is
None
:
if
grads
is
None
:
grads_group
=
[
None
]
*
len
(
self
.
param_groups
)
grads_group
=
[
None
]
*
len
(
self
.
param_groups
)
...
...
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