MCPcopy
hub / github.com/NVlabs/SPADE / save_network

Function save_network

util/util.py:195–200  ·  view source on GitHub ↗
(net, label, epoch, opt)

Source from the content-addressed store, hash-verified

193
194
195def save_network(net, label, epoch, opt):
196 save_filename = '%s_net_%s.pth' % (epoch, label)
197 save_path = os.path.join(opt.checkpoints_dir, opt.name, save_filename)
198 torch.save(net.cpu().state_dict(), save_path)
199 if len(opt.gpu_ids) and torch.cuda.is_available():
200 net.cuda()
201
202
203def load_network(net, label, epoch, opt):

Callers

nothing calls this directly

Calls 1

saveMethod · 0.45

Tested by

no test coverage detected