code: def __init__(self, latent_dim: int, img_shape: tuple):
      super().__init__()
      self.img_shape = img_shape
  
      def block(in_feat, out_feat, normalize=True):
          layers = [nn.Linear(in_feat, out_feat)]
          if normalize:
              layers.append(nn.BatchNorm1d(out_feat, 0.8))
          layers.append(nn.LeakyReLU(0.2, inplace=True))
          return layers
  
      self.model = nn.Sequential(
          *block(latent_dim, 128, normalize=False),
          *block(128, 256),
          *block(256, 512),
          *block(512, 1024),
          nn.Linear(1024, int(np.prod(img_shape))),
          nn.Tanh(),
      )
  
imports: import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from lightning.pytorch.core.module import LightningModule
  from torch.utils.data import DataLoader
  from tests_pytorch import _PATH_DATASETS
  from tests_pytorch.helpers.datasets import MNIST, AverageDataset, TrialMNIST
label_desc: Use image node_id 1 to create a new Generator object from inherited base classes: nn with example: obj = Generator(latent_dim, img_shape)