Higher pytorch version raise error when training with GAN Net

Your code is unfortunately not properly formatted so quite hard to read.
However, you might be running into this error which is correctly raised if stale forward activations would lead to a wrong gradient computation.