class_docstr: Multi-level fused semantic segmentation head.
  
  .. code-block:: none
  
      in_1 -> 1x1 conv ---
                          |
      in_2 -> 1x1 conv -- |
                         ||
      in_3 -> 1x1 conv - ||
                        |||                  /-> 1x1 conv (mask prediction)
      in_4 -> 1x1 conv -----> 3x3 convs (*4)
                          |                  \-> 1x1 conv (feature)
      in_5 -> 1x1 conv ---
class_docstr_tok: ["Multi-level","fused","semantic","segmentation","head",".","..","code-block",":",":","none","in_1","-",">","1x1","conv","--","-","|","in_2","-",">","1x1","conv","--","|","||","in_3","-",">","1x1","conv","-","||","|||","\/-",">","1x1","conv","(","mask","prediction",")","in_4","-",">","1x1","conv","--","--","-",">","3x3","convs","(","*","4",")","|","\\-",">","1x1","conv","(","feature",")","in_5","-",">","1x1","conv","--","-"]
docstr: Loss function.
  
  Args:
      mask_preds (Tensor): Predicted mask logits.
      labels (Tensor): Ground truth.
  
  Returns:
      Tensor: Semantic segmentation loss.
docstr_tok: ["Loss","function",".","Args",":","mask_preds","(","Tensor",")",":","Predicted","mask","logits",".","labels","(","Tensor",")",":","Ground","truth",".","Returns",":","Tensor",":","Semantic","segmentation","loss","."]
code: def loss(self, mask_preds: Tensor, labels: Tensor) -> Tensor:
      """Loss function.
  
      Args:
          mask_preds (Tensor): Predicted mask logits.
          labels (Tensor): Ground truth.
  
      Returns:
          Tensor: Semantic segmentation loss.
      """
      labels = F.interpolate(
          labels.float(),
          scale_factor=self.seg_scale_factor,
          mode="nearest",
      )
      labels = labels.squeeze(1).long()
      loss_semantic_seg = self.criterion(mask_preds, labels)
      return loss_semantic_seg
  
file_path: mmdetection/mmdet/models/roi_heads/mask_heads/fused_semantic_head.py
imports: import warnings
  from typing import Tuple
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import ConvModule
  from mmengine.config import ConfigDict
  from mmengine.model import BaseModule
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.utils import MultiConfig, OptConfigType
label_desc: Use image node_id 3 for calling the FusedSemanticHead obj's underlying member method code with example usage: obj.loss(mask_preds, labels) and returns: loss_semantic_seg