From d02aa2ad8f96ca7c96f9552be7cf4d1a4a26b75c Mon Sep 17 00:00:00 2001 From: rickdeu Date: Sun, 2 Apr 2023 21:24:55 +0100 Subject: [PATCH] use else blocks --- common/checkpointing/snapshot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/checkpointing/snapshot.py b/common/checkpointing/snapshot.py index 2703efd..f20b25d 100644 --- a/common/checkpointing/snapshot.py +++ b/common/checkpointing/snapshot.py @@ -73,8 +73,8 @@ def restore(self, checkpoint: str) -> None: snapshot.restore(self.state) # we still need to ensure that extra_state has walltime in it self.state["extra_state"] = torchsnapshot.StateDict(step=self.step, walltime=0.0) - - logging.info(f"Restored snapshot from {snapshot.path}. ({time.time() - start_time:.05}s") + else: + logging.info(f"Restored snapshot from {snapshot.path}. ({time.time() - start_time:.05}s") @classmethod def get_torch_snapshot(