(self, cfg: Config, *, parent: Optional[Module])
| 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__() |
no test coverage detected