Could you try to detach the generator output when you train the discriminator on the fake data?
y_pred_fake = discriminator_net(fake_data_on_gpu.detach())

This will make sure to create gradients in the generator in this step.
When you train your generator you should just pass the fake input without detaching as shown in the DCGAN example.
Also as a small side note: you should’n use forward but just call the model directly with the input as shown in my code snippet.
This will make sure to properly register all hooks if necessary.