(self, network, network_label, epoch_label, gpu_ids)
| 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 |