@@ -177,7 +177,7 @@ def load_state_dict(self, state_dict, move_to_device=True):
177
177
raise ValueError ("loaded state dict has a different number of parameter groups" )
178
178
param_lens = (len (g ["params" ]) for g in groups )
179
179
saved_lens = (len (g ["params" ]) for g in saved_groups )
180
- if any (p_len != s_len for p_len , s_len in zip (param_lens , saved_lens , strict = True )):
180
+ if any (p_len != s_len for p_len , s_len in zip (param_lens , saved_lens )):
181
181
raise ValueError (
182
182
"loaded state dict contains a parameter group that doesn't match the size of optimizer's group" ,
183
183
)
@@ -188,7 +188,6 @@ def load_state_dict(self, state_dict, move_to_device=True):
188
188
for old_id , p in zip (
189
189
chain .from_iterable (g ["params" ] for g in saved_groups ),
190
190
chain .from_iterable (g ["params" ] for g in groups ),
191
- strict = True ,
192
191
)
193
192
}
194
193
@@ -230,7 +229,7 @@ def update_group(group, new_group):
230
229
new_group ["params" ] = group ["params" ]
231
230
return new_group
232
231
233
- param_groups = [update_group (g , ng ) for g , ng in zip (groups , saved_groups , strict = True )]
232
+ param_groups = [update_group (g , ng ) for g , ng in zip (groups , saved_groups )]
234
233
self .__setstate__ ({"state" : state , "param_groups" : param_groups })
235
234
236
235
def to_gpu (self ):
0 commit comments