MCPcopy Index your code
hub / github.com/pytorch/examples / _save_checkpoint

Method _save_checkpoint

distributed/ddp-tutorial-series/single_gpu.py:37–41  ·  view source on GitHub ↗
(self, epoch)

Source from the content-addressed store, hash-verified

35 self._run_batch(source, targets)
36
37 def _save_checkpoint(self, epoch):
38 ckp = self.model.state_dict()
39 PATH = "checkpoint.pt"
40 torch.save(ckp, PATH)
41 print(f"Epoch {epoch} | Training checkpoint saved at {PATH}")
42
43 def train(self, max_epochs: int):
44 for epoch in range(max_epochs):

Callers 1

trainMethod · 0.95

Calls 1

saveMethod · 0.80

Tested by

no test coverage detected