Solved by ptrblck in post #4 
              
              
                Variables are deprecated since PyTorch 0.4.0, so you can just use tensors instead. 
You should detach the tensors coming from your generator, which should not create gradients in the generator. In a vanilla GAN setup you don’t want gradients in your generator while training your discriminator with t…