Hi,
No because you actually want to compute some gradients in D. You want to compute the gradients wrt the input of D that you then use to compute the ones for G.
If you don’t want to update D, you can simply only pass G.parameters() to your optimizer