Unverified Commit 3637b86b authored by kouml's avatar kouml Committed by GitHub
Browse files

add representation to optimizer (#181)

parent c1a3ec67
...@@ -531,3 +531,6 @@ class FP16_DeepSpeedZeroOptimizer(object): ...@@ -531,3 +531,6 @@ class FP16_DeepSpeedZeroOptimizer(object):
for current, saved in zip(self.single_partition_of_fp32_groups, state_dict['single_partition_of_fp32_groups']): for current, saved in zip(self.single_partition_of_fp32_groups, state_dict['single_partition_of_fp32_groups']):
current.data.copy_(saved.data) current.data.copy_(saved.data)
def __repr__(self):
return repr(self.optimizer)
...@@ -337,3 +337,6 @@ class FP16_Optimizer(object): ...@@ -337,3 +337,6 @@ class FP16_Optimizer(object):
# 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_flat, state_dict['fp32_groups_flat']): for current, saved in zip(self.fp32_groups_flat, state_dict['fp32_groups_flat']):
current.data.copy_(saved.data) current.data.copy_(saved.data)
def __repr__(self):
return repr(self.optimizer)
...@@ -325,3 +325,6 @@ class FP16_UnfusedOptimizer(object): ...@@ -325,3 +325,6 @@ class FP16_UnfusedOptimizer(object):
for current_group, saved_group in zip(self.fp32_groups, state_dict['fp32_groups']): for current_group, saved_group in zip(self.fp32_groups, state_dict['fp32_groups']):
for current, saved in zip(current_group, saved_group): for current, saved in zip(current_group, saved_group):
current.data.copy_(saved.data) current.data.copy_(saved.data)
def __repr__(self):
return repr(self.optimizer)
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