code: def training_step(self, batch, batch_idx):
      loss, loss_dict = self.shared_step(batch)
  
      self.log_dict(
          loss_dict,
          prog_bar=True,
          logger=True,
          on_step=True,
          on_epoch=False,
      )
  
      self.log(
          "global_step",
          self.global_step,
          prog_bar=True,
          logger=True,
          on_step=True,
          on_epoch=False,
      )
  
      if self.scheduler_config is not None:
          lr = self.optimizers().param_groups[0]["lr"]
          self.log(
              "lr_abs",
              lr,
              prog_bar=True,
              logger=True,
              on_step=True,
              on_epoch=False,
          )
  
      return loss
  
imports: import math
  from contextlib import contextmanager
  from typing import Any, Dict, List, Optional, Tuple, Union
  import pytorch_lightning
  import torch
  from omegaconf import ListConfig, OmegaConf
  from safetensors.torch import load_file
  from torch.optim.lr_scheduler import LambdaLR
  from ..modules import UNCONDITIONAL_CONFIG
  from ..modules.autoencoding.temporal_ae import VideoDecoder
  from ..modules.diffusionmodules.wrappers import OPENAIUNETWRAPPER
  from ..modules.ema import LitEma
  from ..util import default, disabled_train, get_obj_from_str, instantiate_from_config, log_txt_as_img
label_desc: Use image node_id 9 for calling the DiffusionEngine obj's underlying member method code with example usage: obj.training_step(batch, batch_idx) and returns: loss