MCPcopy Create free account
hub / github.com/apple/axlearn / __init__

Method __init__

axlearn/common/checkpointer.py:1043–1057  ·  view source on GitHub ↗
(self, cfg: Config, *, parent: Optional[Module])

Source from the content-addressed store, hash-verified

1041 multihost_utils.sync_global_devices(f"{ckpt_dir}_cleanup")
1042
1043 def __init__(self, cfg: Config, *, parent: Optional[Module]):
1044 super().__init__(cfg, parent=parent)
1045 cfg: Checkpointer.Config = self.config
1046 if cfg.index_writer is None:
1047 self._index_writer = write_index_file
1048 else:
1049 self._index_writer = maybe_instantiate(cfg.index_writer)
1050
1051 self._storage: StateStorage = cfg.storage.instantiate()
1052 self._gc_stopping = None
1053 self._gc_thread = None
1054 self._save_policy: CheckpointPolicy = cfg.save_policy.instantiate()
1055 if cfg.summary_writer is not None:
1056 cfg.summary_writer.dir = cfg.summary_writer.dir or cfg.dir
1057 self._add_child("summary_writer", cfg.summary_writer)
1058
1059 def __enter__(self):
1060 super().__enter__()

Callers 3

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 3

maybe_instantiateFunction · 0.90
_add_childMethod · 0.80
instantiateMethod · 0.45

Tested by

no test coverage detected