class_docstr: Detection Head of `DDOD <https://arxiv.org/abs/2107.02963>`_.
  
  DDOD head decomposes conjunctions lying in most current one-stage
  detectors via label assignment disentanglement, spatial feature
  disentanglement, and pyramid supervision disentanglement.
  
  Args:
      num_classes (int): Number of categories excluding the
          background category.
      in_channels (int): Number of channels in the input feature map.
      stacked_convs (int): The number of stacked Conv. Defaults to 4.
      conv_cfg (:obj:`ConfigDict` or dict, optional): Config dict for
          convolution layer. Defaults to None.
      use_dcn (bool): Use dcn, Same as ATSS when False. Defaults to True.
      norm_cfg (:obj:`ConfigDict` or dict): Normal config of ddod head.
          Defaults to dict(type='GN', num_groups=32, requires_grad=True).
      loss_iou (:obj:`ConfigDict` or dict): Config of IoU loss. Defaults to
          dict(type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0).
docstr: Compute cls loss of a single scale level.
  
  Args:
      cls_score (Tensor): Box scores for each scale level
          Has shape (N, num_base_priors * num_classes, H, W).
      labels (Tensor): Labels of each anchors with shape
          (N, num_total_anchors).
      label_weights (Tensor): Label weights of each anchor with shape
          (N, num_total_anchors)
      reweight_factor (List[float]): Reweight factor for cls and reg
          loss.
      avg_factor (float): Average factor that is used to average
          the loss. When using sampling method, avg_factor is usually
          the sum of positive and negative priors. When using
          `PseudoSampler`, `avg_factor` is usually equal to the number
          of positive priors.
  
  Returns:
      Tuple[Tensor]: A tuple of loss components.
docstr_tok: ["Compute","cls","loss","of","a","single","scale","level",".","Args",":","cls_score","(","Tensor",")",":","Box","scores","for","each","scale","level","Has","shape","(","N",",","num_base_priors","*","num_classes",",","H",",","W",")",".","labels","(","Tensor",")",":","Labels","of","each","anchors","with","shape","(","N",",","num_total_anchors",")",".","label_weights","(","Tensor",")",":","Label","weights","of","each","anchor","with","shape","(","N",",","num_total_anchors",")","reweight_factor","(","List","[","float","]",")",":","Reweight","factor","for","cls","and","reg","loss",".","avg_factor","(","float",")",":","Average","factor","that","is","used","to","average","the","loss",".","When","using","sampling","method",",","avg_factor","is","usually","the","sum","of","positive","and","negative","priors",".","When","using","`","PseudoSampler","`",",","`","avg_factor","`","is","usually","equal","to","the","number","of","positive","priors",".","Returns",":","Tuple","[","Tensor","]",":","A","tuple","of","loss","components","."]
code: def loss_cls_by_feat_single(
      self,
      cls_score: Tensor,
      labels: Tensor,
      label_weights: Tensor,
      reweight_factor: List[float],
      avg_factor: float,
  ) -> Tuple[Tensor]:
      """Compute cls loss of a single scale level.
  
      Args:
          cls_score (Tensor): Box scores for each scale level
              Has shape (N, num_base_priors * num_classes, H, W).
          labels (Tensor): Labels of each anchors with shape
              (N, num_total_anchors).
          label_weights (Tensor): Label weights of each anchor with shape
              (N, num_total_anchors)
          reweight_factor (List[float]): Reweight factor for cls and reg
              loss.
          avg_factor (float): Average factor that is used to average
              the loss. When using sampling method, avg_factor is usually
              the sum of positive and negative priors. When using
              `PseudoSampler`, `avg_factor` is usually equal to the number
              of positive priors.
  
      Returns:
          Tuple[Tensor]: A tuple of loss components.
      """
      cls_score = (
          cls_score.permute(0, 2, 3, 1)
          .reshape(-1, self.cls_out_channels)
          .contiguous()
      )
      labels = labels.reshape(-1)
      label_weights = label_weights.reshape(-1)
      loss_cls = self.loss_cls(
          cls_score, labels, label_weights, avg_factor=avg_factor
      )
      return (reweight_factor * loss_cls,)
  
imports: from typing import List, Optional, Sequence, Tuple
  import torch
  import torch.nn
  from mmcv.cnn import ConvModule, Scale
  from mmengine.model import bias_init_with_prob, normal_init
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS, TASK_UTILS
  from mmdet.structures.bbox import bbox_overlaps
  from mmdet.utils import ConfigType, InstanceList, OptConfigType, OptInstanceList, reduce_mean
  from ..task_modules.prior_generators import anchor_inside_flags
  from ..utils import images_to_levels, multi_apply, unmap
  from .anchor_head import AnchorHead
label_desc: Use image node_id 6 for calling the DDODHead obj's underlying member method code with example usage: obj.loss_cls_by_feat_single(cls_score, labels, label_weights, reweight_factor, avg_factor) and returns: unknown