File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
src/lightning/pytorch/loops Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -354,16 +354,20 @@ def reset(self) -> None:
354354 # TODO LUCA: refactor restarting for fit_loop
355355 restarting_mid_epoch = self .restarting_mid_epoch
356356
357- if (self .epoch_loop .restarting_on_train_batch_end
357+ if (
358+ self .epoch_loop .restarting_on_train_batch_end
358359 and self .restarting_mid_epoch
359- and self .epoch_loop .batch_progress .is_last_batch ):
360+ and self .epoch_loop .batch_progress .is_last_batch
361+ ):
360362 self .epoch_progress .increment_processed ()
361363 self .epoch_progress .increment_completed ()
362364
363- if (self .epoch_loop .restarting_on_train_batch_end
365+ if (
366+ self .epoch_loop .restarting_on_train_batch_end
364367 and self .epoch_loop .batch_progress .is_last_batch
365368 and not restarting_mid_epoch
366- and not self .epoch_loop .val_loop .batch_progress .is_last_batch ):
369+ and not self .epoch_loop .val_loop .batch_progress .is_last_batch
370+ ):
367371 self .epoch_progress .increment_completed ()
368372
369373 def on_run_start (self ) -> None :
Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ def reset(self) -> None:
182182 # happens on_validation_end
183183 # we could set it in the checkpoint but we prefer to keep checkpoints backward compatible
184184 if self .restarting_on_train_batch_end or not self .restarting_on_last :
185- # if not self.restarting_on_train_batch_end and not self.restarting_on_last:
185+ # if not self.restarting_on_train_batch_end and not self.restarting_on_last:
186186 self ._batches_that_stepped += 1
187187
188188 if self .restarting_on_train_batch_end :
You can’t perform that action at this time.
0 commit comments