Here’s a DCGAN tutotial
https://pytorch.org/tutorials/beginner/dcgan_faces_tutorial.html 1
When evaluating the performance, .eval() and .train() is completely ignored, no mention of them in the entire code. Why is that? Thanks.
EDIT: here, I can point to the exact line where I think this is missing

  
      github.com
  
  
    pytorch/tutorials/blob/master/beginner_source/dcgan_faces_tutorial.py#L646

        # Output training stats
        if i % 50 == 0:
            print('[%d/%d][%d/%d]\tLoss_D: %.4f\tLoss_G: %.4f\tD(x): %.4f\tD(G(z)): %.4f / %.4f'
                  % (epoch, num_epochs, i, len(dataloader),
                     errD.item(), errG.item(), D_x, D_G_z1, D_G_z2))
        
        # Save Losses for plotting later
        G_losses.append(errG.item())
        D_losses.append(errD.item())
        
        # Check how the generator is doing by saving G's output on fixed_noise
        if (iters % 500 == 0) or ((epoch == num_epochs-1) and (i == len(dataloader)-1)):
            with torch.no_grad():
                fake = netG(fixed_noise).detach().cpu()
            img_list.append(vutils.make_grid(fake, padding=2, normalize=True))
            
        iters += 1




######################################################################
# Results