You’ve dropped the detach() operation from the tutorial in:
# Classify all fake batch with D
output = netD(fake.detach()).view(-1)

which will then try to compute the gradients in netG twice: the first time using errD_fake.backward(), the second time using errG.backward().