Commit 01e29c97 authored by Michael Carilli's avatar Michael Carilli
Browse files

minor fix

parent ed14f39c
...@@ -271,10 +271,10 @@ class DistributedDataParallel(Module): ...@@ -271,10 +271,10 @@ class DistributedDataParallel(Module):
# Forward has the authority to set needs_refresh to True, but only allreduce_params # Forward has the authority to set needs_refresh to True, but only allreduce_params
# in backward has the authority to set needs_refresh to False. # in backward has the authority to set needs_refresh to False.
# Parentheses are not necessary for correct order of operations, but make the intent clearer. # Parentheses are not necessary for correct order of operations, but make the intent clearer.
if (not self.param_refs) or if ( (not self.param_refs) or
self.shared_param or self.shared_param or
(len(param_list) != len(self.param_refs)) or (len(param_list) != len(self.param_refs)) or
any([param1 is not param2 for param1, param2 in zip(param_list, self.param_refs)]): any([param1 is not param2 for param1, param2 in zip(param_list, self.param_refs)]) ):
self.needs_refresh = True self.needs_refresh = True
if self.needs_refresh: if self.needs_refresh:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment