MCPcopy
hub / github.com/HobbitLong/SupContrast / save_model

Function save_model

util.py:86–95  ·  view source on GitHub ↗
(model, optimizer, opt, epoch, save_file)

Source from the content-addressed store, hash-verified

84
85
86def save_model(model, optimizer, opt, epoch, save_file):
87 print('==> Saving...')
88 state = {
89 'opt': opt,
90 'model': model.state_dict(),
91 'optimizer': optimizer.state_dict(),
92 'epoch': epoch,
93 }
94 torch.save(state, save_file)
95 del state

Callers 2

mainFunction · 0.90
mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected