mirror of
https://github.com/twitter/the-algorithm-ml.git
synced 2025-01-09 22:39:22 +01:00
use else blocks
This commit is contained in:
parent
78c3235eee
commit
d02aa2ad8f
@ -73,8 +73,8 @@ class Snapshot:
|
|||||||
snapshot.restore(self.state)
|
snapshot.restore(self.state)
|
||||||
# we still need to ensure that extra_state has walltime in it
|
# we still need to ensure that extra_state has walltime in it
|
||||||
self.state["extra_state"] = torchsnapshot.StateDict(step=self.step, walltime=0.0)
|
self.state["extra_state"] = torchsnapshot.StateDict(step=self.step, walltime=0.0)
|
||||||
|
else:
|
||||||
logging.info(f"Restored snapshot from {snapshot.path}. ({time.time() - start_time:.05}s")
|
logging.info(f"Restored snapshot from {snapshot.path}. ({time.time() - start_time:.05}s")
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_torch_snapshot(
|
def get_torch_snapshot(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user