Closed Ha0Tang closed 4 years ago
Our MACs computation depends on torchprofile. You could check the profile function in models/test_model.py.
def profile(self, config=None, verbose=True): netG = self.netG if isinstance(netG, nn.DataParallel): netG = netG.module if config is not None: netG.configs = config with torch.no_grad(): macs = profile_macs(netG, (self.real_A[:1],)) params = 0 for p in netG.parameters(): params += p.numel() if verbose: print('MACs: %.3fG\tParams: %.3fM' % (macs / 1e9, params / 1e6), flush=True) return macs, params
Many thanks.
Our MACs computation depends on torchprofile. You could check the profile function in models/test_model.py.