MCPcopy Create free account
hub / github.com/NVIDIA/vid2vid / save_network

Method save_network

models/base_model.py:43–48  ·  view source on GitHub ↗
(self, network, network_label, epoch_label, gpu_ids)

Source from the content-addressed store, hash-verified

41
42 # helper saving function that can be used by subclasses
43 def save_network(self, network, network_label, epoch_label, gpu_ids):
44 save_filename = '%s_net_%s.pth' % (epoch_label, network_label)
45 save_path = os.path.join(self.save_dir, save_filename)
46 torch.save(network.cpu().state_dict(), save_path)
47 if len(gpu_ids) and torch.cuda.is_available():
48 network.cuda(gpu_ids[0])
49
50 def resolve_version(self):
51 import torch._utils

Callers 2

saveMethod · 0.80
saveMethod · 0.80

Calls 1

saveMethod · 0.45

Tested by

no test coverage detected