Commit 35e86d3d authored by Kexin Yu's avatar Kexin Yu
Browse files

add additional loop for lists of params when loading state_dict in...

add additional loop for lists of params when loading state_dict in apex.contrib.optimizers.FP16_Optimizer
parent 93f91cde
...@@ -239,4 +239,5 @@ class FP16_Optimizer(object): ...@@ -239,4 +239,5 @@ class FP16_Optimizer(object):
# constructed in the same way as the one whose state_dict we are loading, the same master params # constructed in the same way as the one whose state_dict we are loading, the same master params
# are guaranteed to exist, so we can just copy_() from the saved master params. # are guaranteed to exist, so we can just copy_() from the saved master params.
for current, saved in zip(self.fp32_groups, state_dict['fp32_groups']): for current, saved in zip(self.fp32_groups, state_dict['fp32_groups']):
current.data.copy_(saved.data) for _current, _saved in zip(current, saved):
_current.data.copy_(_saved.data)
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