class_docstr: Control the loops for training, evaluation, and prediction. This module is independent of
  the model definition. This class inherits from the Pytorch Lightning's LightningModule:
  https://lightning.ai/docs/pytorch/stable/common/lightning_module.html
code: def _shared_step(
      self,
      batch: Dict,
  ):
      label = batch[self.model.label_key]
      # prepare_targets
      output = run_model(self.model, batch)
      if isinstance(self.loss_func, Mask2FormerLoss):
          loss = self._compute_loss(
              output=output,
              label=label,
              mask_labels=batch[self.model.mask_label_key],
              class_labels=batch[self.model.class_label_key],
          )
      else:
          loss = self._compute_loss(
              output=output,
              label=label,
          )
  
      return output, loss
  
file_path: autogluon/multimodal/src/autogluon/multimodal/optimization/lit_semantic_seg.py
imports: import logging
  from typing import Callable, Dict
  import torch
  import torchmetrics
  from transformers.models.mask2former.modeling_mask2former import Mask2FormerLoss
  from ..constants import CLASS_LOGITS, LOGITS, SEMANTIC_MASK, WEIGHT
  from ..models.utils import run_model
  from .lit_module import LitModule
  from .semantic_seg_metrics import Multiclass_IoU
label_desc: Use image node_id 3 for calling the SemanticSegmentationLitModule obj's underlying member method code with example usage: obj._shared_step(batch) and returns: output,  loss