Skip to content

Commit d303d27

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent e64c200 commit d303d27

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/lightning/pytorch/loops/fit_loop.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff 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:

src/lightning/pytorch/loops/training_epoch_loop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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:

0 commit comments

Comments
 (0)