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

Function checkpoint

super_resolution/main.py:76–79  ·  view source on GitHub ↗
(epoch)

Source from the content-addressed store, hash-verified

74
75
76def checkpoint(epoch):
77 model_out_path = "model_epoch_{}.pth".format(epoch)
78 torch.save(model, model_out_path)
79 print("Checkpoint saved to {}".format(model_out_path))
80
81for epoch in range(1, opt.nEpochs + 1):
82 train(epoch)

Callers 1

main.pyFile · 0.85

Calls 1

saveMethod · 0.80

Tested by

no test coverage detected