We introduce a new nonparametric representation of the neutron star (NS) equation of state (EoS) by using the variational auto-encoder (VAE). As a deep neural network, the VAE is widely used for dimensionality reduction since it can compress input data to a low dimensional latent space using the encoder component and then reconstruct the data using the decoder component. Once a VAE is trained one can take the decoder of the VAE as a generator. We employ 100,000 EoSs generated with the nonparametric representation method in Han et al. (2021) as the training set and try different settings of the neural network, then get an EoS generator (trained VAE's decoder) with 4 parameters. We use the mass-tidal-deformability data of binary neutron star (BNS) merger event GW170817, and the mass-radius data of PSR J0030+0451, PSR J0740-6620, PSR J0437-4715, and 4U 1702-429 to perform the joint Bayesian inference. We find out that R 1.4 = 12.66 +0.71 −0.54 km, Λ 1.4 = 484 +118 −90 , and M max = 2.30 +0.30 −0.21 M (90% credible levels), where R 1.4 /Λ 1.4 are the radius/tidal-deformability of a canonical 1.4 M NS, and M max is the maximum mass of a non-rotating NS.