Solved by albanD in post #8 
              
              
                How are these loop nested? Like this: 
for i, data in enumerate(all_dataloader):
  # Generate all train_full, generated_y etc
  for j in range(critic_policy(epoch)):
    # The code from your first post

If so, what most likely happens is that netG has some parameters that require gradients. So gener…