def _save(self, phase, epoch):
        """Save model state dict and generator's samples"""
        for i in range(cfg.k_label):
            torch.save(self.gen_list[i].state_dict(),
                       cfg.save_model_root + 'gen{}_{}_{:05d}.pt'.format(i, phase, epoch))
            save_sample_path = cfg.save_samples_root + 'samples_d{}_{}_{:05d}.txt'.format(i, phase, epoch)
            samples = self.gen_list[i].sample(cfg.batch_size, cfg.batch_size)
            write_tensor(save_sample_path, samples)
Save model state dict and generator's samples
instructor/oracle_data/sentigan_instructor.py