Inplace-operation in F.binary_cross_entropy() or squeeze() during gradient computation

I guess a previous operation might have manipulated a tensor inplace and raises the error in the backward pass. Since you are working with a GAN, have a look at this post and check if you could be hitting the same issue.