class_docstr: >>> GAN(img_shape=(1, 8, 8))  # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
  GAN(
    (generator): Generator(
      (model): Sequential(...)
    )
    (discriminator): Discriminator(
      (model): Sequential(...)
    )
  )
class_docstr_tok: [">",">",">","GAN","(","img_shape=","(","1",",","8",",","8",")",")","#","doctest",":","+ELLIPSIS","+NORMALIZE_WHITESPACE","GAN","(","(","generator",")",":","Generator","(","(","model",")",":","Sequential","(","...",")",")","(","discriminator",")",":","Discriminator","(","(","model",")",":","Sequential","(","...",")",")",")"]
code: def on_train_epoch_end(self):
      z = self.validation_z.type_as(self.generator.model[0].weight)
  
      # log sampled images
      sample_imgs = self(z)
      grid = torchvision.utils.make_grid(sample_imgs)
      for logger in self.loggers:
          logger.experiment.add_image(
              "generated_images", grid, self.current_epoch
          )
  
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 6 for calling the GAN obj's underlying member method code with example usage: obj.on_train_epoch_end() without return types