MCPcopy Create free account
hub / github.com/pytorch/examples / __init__

Method __init__

distributed/FSDP2/checkpoint.py:40–45  ·  view source on GitHub ↗
(self, folder: str, dcp_api: bool)

Source from the content-addressed store, hash-verified

38
39class Checkpointer:
40 def __init__(self, folder: str, dcp_api: bool):
41 self.folder = folder
42 self.dcp_api = dcp_api
43 self.last_training_time = get_latest_checkpoint_folder(
44 f"{folder}/{'dcp_api' if dcp_api else 'dtensor_api'}"
45 )
46
47 def is_empty(self):
48 return self.last_training_time is None

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected