Hi,
The problem is that you re-use the outputs from netD after it has been updated with optimizerD.step(). And since the weights were changed inplace, you cannot backpropagate through these computations anymore.
You will need to either re-compute these outputs after the network has been updated. Or delay the optimizer step after all the backward passes have been done.