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 _compute_loss(self, output: Dict, label: torch.Tensor, **kwargs):
      loss = 0
      for _, per_output in output.items():
          weight = per_output[WEIGHT] if WEIGHT in per_output else 1
          if isinstance(self.loss_func, Mask2FormerLoss):
              mask_labels = [
                  mask_labels.to(per_output[LOGITS])
                  for mask_labels in kwargs["mask_labels"]
              ]
              dict_loss = self.loss_func(
                  masks_queries_logits=per_output[
                      LOGITS
                  ],  # bs, num_mask_tokens, height, width
                  class_queries_logits=per_output[
                      CLASS_LOGITS
                  ],  # bs, num_mask_tokens, num_classes
                  mask_labels=mask_labels,
                  class_labels=kwargs["class_labels"],
              )
              for v in dict_loss.values():
                  loss += v
          else:
              loss += (
                  self.loss_func(
                      input=per_output[LOGITS],
                      target=label,
                  )
                  * weight
              )
      return 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 1 for calling the SemanticSegmentationLitModule obj's underlying member method code with example usage: obj._compute_loss(output, label) and returns: loss