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
1d45fada
Commit
1d45fada
authored
Aug 14, 2018
by
Michael Carilli
Browse files
Fix to enable freezing params
parent
2063287b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
apex/parallel/distributed.py
apex/parallel/distributed.py
+2
-2
No files found.
apex/parallel/distributed.py
View file @
1d45fada
...
...
@@ -136,7 +136,7 @@ class DistributedDataParallel(Module):
torch
.
cuda
.
current_stream
().
wait_stream
(
self
.
reduction_stream
)
for
param_i
,
param
in
enumerate
(
list
(
self
.
module
.
parameters
()
)
):
for
param_i
,
param
in
enumerate
(
[
p
for
p
in
self
.
module
.
parameters
()
if
p
.
requires_grad
]
):
def
wrapper
(
param_i
):
def
allreduce_hook
(
*
unused
):
...
...
@@ -203,7 +203,7 @@ class DistributedDataParallel(Module):
def
forward
(
self
,
*
inputs
,
**
kwargs
):
param_list
=
[
param
for
param
in
list
(
self
.
module
.
parameters
()
)
if
param
.
requires_grad
]
param_list
=
[
param
for
param
in
self
.
module
.
parameters
()
if
param
.
requires_grad
]
#Force needs_refresh to True if there are shared params
...
...
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