@@ -173,7 +173,7 @@ def load_state_dict(self, state_dict, move_to_device=True):
173
173
raise ValueError ("loaded state dict has a different number of parameter groups" )
174
174
param_lens = (len (g ["params" ]) for g in groups )
175
175
saved_lens = (len (g ["params" ]) for g in saved_groups )
176
- if any (p_len != s_len for p_len , s_len in zip (param_lens , saved_lens , strict = True )):
176
+ if any (p_len != s_len for p_len , s_len in zip (param_lens , saved_lens )):
177
177
raise ValueError (
178
178
"loaded state dict contains a parameter group that doesn't match the size of optimizer's group" ,
179
179
)
@@ -184,7 +184,6 @@ def load_state_dict(self, state_dict, move_to_device=True):
184
184
for old_id , p in zip (
185
185
chain .from_iterable (g ["params" ] for g in saved_groups ),
186
186
chain .from_iterable (g ["params" ] for g in groups ),
187
- strict = True ,
188
187
)
189
188
}
190
189
@@ -226,7 +225,7 @@ def update_group(group, new_group):
226
225
new_group ["params" ] = group ["params" ]
227
226
return new_group
228
227
229
- param_groups = [update_group (g , ng ) for g , ng in zip (groups , saved_groups , strict = True )]
228
+ param_groups = [update_group (g , ng ) for g , ng in zip (groups , saved_groups )]
230
229
self .__setstate__ ({"state" : state , "param_groups" : param_groups })
231
230
232
231
def to_gpu (self ):
0 commit comments