A tensor shape records the dimensions of data and determines how a network output is laid out. In a GAN, out_shape specifies the generator output and discriminator input shape. section 9.1.3
The shape (-1, 28, 28) keeps the batch dimension flexible while arranging each generated MNIST example as a 28-by-28 image. The final linear layer produces abs(np.prod(out_shape)) values, then View(out_shape) reshapes them. section 9.1.3
Reshaping a GAN output
Set out_shape = (-1, 28, 28), pass it to simpleGAN, and obtain G(z) in image-shaped batches rather than flat vectors.




