File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
torchtnt/framework/callbacks Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,11 @@ class RestoreOptions:
40
40
restore_eval_progress: Whether to restore the evaluation progress state.
41
41
restore_optimizers: Whether to restore the optimizer states.
42
42
restore_lr_schedulers: Whether to restore the lr scheduler states.
43
+ strict: Whether to strictly restore app state and the module state dict.
43
44
"""
44
45
45
46
restore_train_progress : bool = True
46
47
restore_eval_progress : bool = True
47
48
restore_optimizers : bool = True
48
49
restore_lr_schedulers : bool = True
50
+ strict : bool = True
Original file line number Diff line number Diff line change @@ -341,7 +341,8 @@ def restore(
341
341
342
342
knob_options = knob_options or KnobOptions ()
343
343
with _override_knobs (knob_options ):
344
- snapshot .restore (app_state , strict = strict )
344
+ strict = strict or restore_options .strict
345
+ snapshot .restore (app_state , strict = restore_options .strict )
345
346
rank_zero_info (f"Restored snapshot from path: { path } " , logger = logger )
346
347
347
348
You can’t perform that action at this time.
0 commit comments