I have a question regarding the .backward() calls in the DCGAN tutorial.
When training the discriminator, an error for the real data, errD_real, and an error for the fake data, errD_fake, is calculated. Each of these have .backward() called on them before the .step() method is called on the optimiser.
How does this work? Would the second .backward() call not overwrite the gradient values stored in .grad attribute of the optimiser?
Thanks for your help!