How to extract the latent representation of a GAN


Suppose, I have trained a GAN on some dataset, MNIST. I don’t understand what is the latent representation in a GAN means. In autoencoder, z is the compressed hidden layer.

So, I can just extract the hidden layer representations and call that vector the hidden value.

How to extract such value in GAN? Could you show how to do that in Pytorch?