class_docstr: Generate latent parameters for MNIST image data. 
class_docstr_tok: ["Generate","latent","parameters","for","MNIST","image","data","."]
code: def __init__(self, latent_dim, num_hidden_layers=1):
      super(Enc, self).__init__()
      modules = []
      modules.append(
          nn.Sequential(nn.Linear(data_dim, hidden_dim), nn.ReLU(True))
      )
      modules.extend(
          [extra_hidden_layer() for _ in range(num_hidden_layers - 1)]
      )
      self.enc = nn.Sequential(*modules)
      self.fc21 = nn.Linear(hidden_dim, latent_dim)
      self.fc22 = nn.Linear(hidden_dim, latent_dim)
  
imports: import torch
  import torch.distributions
  import torch.nn
  import torch.nn.functional
  from numpy import prod, sqrt
  from torch.utils.data import DataLoader
  from torchvision import datasets, transforms
  from torchvision.utils import save_image, make_grid
  from utils import Constants
  from vis import plot_embeddings, plot_kls_df
  from .vae import VAE
label_desc: Use image node_id 1 to create a new Enc object from inherited base classes: nn with example: obj = Enc(latent_dim, num_hidden_layers)