class_docstr: >>> Generator(img_shape=(1, 8, 8))  # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
  Generator(
    (model): Sequential(...)
  )
class_docstr_tok: [">",">",">","Generator","(","img_shape=","(","1",",","8",",","8",")",")","#","doctest",":","+ELLIPSIS","+NORMALIZE_WHITESPACE","Generator","(","(","model",")",":","Sequential","(","...",")",")"]
code: def __init__(
      self, latent_dim: int = 100, img_shape: tuple = (1, 28, 28)
  ):
      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: from argparse import ArgumentParser, Namespace
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from lightning.pytorch import cli_lightning_logo
  from lightning.pytorch.core import LightningModule
  from lightning.pytorch.demos.mnist_datamodule import MNISTDataModule
  from lightning.pytorch.trainer import Trainer
  from lightning.pytorch.utilities.imports import _TORCHVISION_AVAILABLE
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)