What are the parameters involved in the gradient calculation of a GAN?

I have designed a GAN in which while training the discriminator I did -
After that I do

I would like to know what are all parameters involved in calculating the gradient of the discriminator and the generator respectively. are all the parameters from both the neural networks are involved since I did retain_graph= True ?