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 the real target.
I’m not familiar with the architecture you would like to implement, but the DCGAN example 114 might be a good reference.