code: def on_train_epoch_end(self, trainer, pl_module, outputs):
      torch.cuda.synchronize(trainer.root_gpu)
      max_memory = (
          torch.cuda.max_memory_allocated(trainer.root_gpu) / 2**20
      )
      epoch_time = time.time() - self.start_time
  
      try:
          max_memory = trainer.training_type_plugin.reduce(max_memory)
          epoch_time = trainer.training_type_plugin.reduce(epoch_time)
  
          rank_zero_info(
              f"Average Epoch time: {epoch_time:.2f} seconds"
          )
          rank_zero_info(f"Average Peak memory {max_memory:.2f}MiB")
      except AttributeError:
          pass
  
imports: import argparse, os, sys, datetime, glob, importlib, csv
  import numpy
  import time
  import torch
  import torchvision
  import pytorch_lightning
  from packaging import version
  from omegaconf import OmegaConf
  from torch.utils.data import random_split, DataLoader, Dataset, Subset
  from functools import partial
  from PIL import Image
  from pytorch_lightning import seed_everything
  from pytorch_lightning.trainer import Trainer
  from pytorch_lightning.callbacks import ModelCheckpoint, Callback, LearningRateMonitor
  from pytorch_lightning.utilities.distributed import rank_zero_only
  from pytorch_lightning.utilities import rank_zero_info
  from ldm.data.base import Txt2ImgIterableBaseDataset
  from ldm.util import instantiate_from_config
label_desc: Use image node_id 2 for calling the CUDACallback obj's underlying member method code with example usage: obj.on_train_epoch_end(trainer, pl_module, outputs) without return types