Assuming get_all_real_minibatch() loads some real sample without using the generator, then the generator won’t get any gradients, as it’s not used during the current computation.



 Bick95:

If this doesn’t work as intended, how could I make it work?


The generator will get the gradients for a “fake input” (created by the generator) and for “real targets”, so that the generator can be updated to learn how to fool the discriminator.
Could you explain your use case a bit?
Currently the posted code doesn’t include the generator, so I’m not sure how gradients should be calculated and what they should represent.