class_docstr: Implementation of `SSD head <https://arxiv.org/abs/1512.02325>`_
  
  Args:
      num_classes (int): Number of categories excluding the background
          category.
      in_channels (Sequence[int]): Number of channels in the input feature
          map.
      stacked_convs (int): Number of conv layers in cls and reg tower.
          Defaults to 0.
      feat_channels (int): Number of hidden channels when stacked_convs
          > 0. Defaults to 256.
      use_depthwise (bool): Whether to use DepthwiseSeparableConv.
          Defaults to False.
      conv_cfg (:obj:`ConfigDict` or dict, Optional): Dictionary to construct
          and config conv layer. Defaults to None.
      norm_cfg (:obj:`ConfigDict` or dict, Optional): Dictionary to construct
          and config norm layer. Defaults to None.
      act_cfg (:obj:`ConfigDict` or dict, Optional): Dictionary to construct
          and config activation layer. Defaults to None.
      anchor_generator (:obj:`ConfigDict` or dict): Config dict for anchor
          generator.
      bbox_coder (:obj:`ConfigDict` or dict): Config of bounding box coder.
      reg_decoded_bbox (bool): If true, the regression loss would be
          applied directly on decoded bounding boxes, converting both
          the predicted boxes and regression targets to absolute
          coordinates format. Defaults to False. It should be `True` when
          using `IoULoss`, `GIoULoss`, or `DIoULoss` in the bbox head.
      train_cfg (:obj:`ConfigDict` or dict, Optional): Training config of
          anchor head.
      test_cfg (:obj:`ConfigDict` or dict, Optional): Testing config of
          anchor head.
      init_cfg (:obj:`ConfigDict` or dict or list[:obj:`ConfigDict` or             dict], Optional): Initialization config dict.
class_docstr_tok: ["Implementation","of","`","SSD","head","<","https",":","\/\/arxiv.org\/abs\/1512.02325",">","`","_","Args",":","num_classes","(","int",")",":","Number","of","categories","excluding","the","background","category",".","in_channels","(","Sequence","[","int","]",")",":","Number","of","channels","in","the","input","feature","map",".","stacked_convs","(","int",")",":","Number","of","conv","layers","in","cls","and","reg","tower",".","Defaults","to","0.","feat_channels","(","int",")",":","Number","of","hidden","channels","when","stacked_convs",">","0",".","Defaults","to","256.","use_depthwise","(","bool",")",":","Whether","to","use","DepthwiseSeparableConv",".","Defaults","to","False",".","conv_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",",","Optional",")",":","Dictionary","to","construct","and","config","conv","layer",".","Defaults","to","None",".","norm_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",",","Optional",")",":","Dictionary","to","construct","and","config","norm","layer",".","Defaults","to","None",".","act_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",",","Optional",")",":","Dictionary","to","construct","and","config","activation","layer",".","Defaults","to","None",".","anchor_generator","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","Config","dict","for","anchor","generator",".","bbox_coder","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","Config","of","bounding","box","coder",".","reg_decoded_bbox","(","bool",")",":","If","true",",","the","regression","loss","would","be","applied","directly","on","decoded","bounding","boxes",",","converting","both","the","predicted","boxes","and","regression","targets","to","absolute","coordinates","format",".","Defaults","to","False",".","It","should","be","`","True","`","when","using","`","IoULoss","`",",","`","GIoULoss","`",",","or","`","DIoULoss","`","in","the","bbox","head",".","train_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",",","Optional",")",":","Training","config","of","anchor","head",".","test_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",",","Optional",")",":","Testing","config","of","anchor","head",".","init_cfg","(",":","obj",":","`","ConfigDict","`","or","dict","or","list","[",":","obj",":","`","ConfigDict","`","or","dict","]",",","Optional",")",":","Initialization","config","dict","."]
docstr: Forward features from the upstream network.
  
  Args:
      x (tuple[Tensor]): Features from the upstream network, each is
          a 4D-tensor.
  
  Returns:
      tuple[list[Tensor], list[Tensor]]: A tuple of cls_scores list and
      bbox_preds list.
  
      - cls_scores (list[Tensor]): Classification scores for all scale             levels, each is a 4D-tensor, the channels number is             num_anchors * num_classes.
      - bbox_preds (list[Tensor]): Box energies / deltas for all scale             levels, each is a 4D-tensor, the channels number is             num_anchors * 4.
docstr_tok: ["Forward","features","from","the","upstream","network",".","Args",":","x","(","tuple","[","Tensor","]",")",":","Features","from","the","upstream","network",",","each","is","a","4D-tensor",".","Returns",":","tuple","[","list","[","Tensor","]",",","list","[","Tensor","]","]",":","A","tuple","of","cls_scores","list","and","bbox_preds","list",".","-","cls_scores","(","list","[","Tensor","]",")",":","Classification","scores","for","all","scale","levels",",","each","is","a","4D-tensor",",","the","channels","number","is","num_anchors","*","num_classes",".","-","bbox_preds","(","list","[","Tensor","]",")",":","Box","energies","\/","deltas","for","all","scale","levels",",","each","is","a","4D-tensor",",","the","channels","number","is","num_anchors","*","4","."]
code: def forward(
      self, x: Tuple[Tensor]
  ) -> Tuple[List[Tensor], List[Tensor]]:
      """Forward features from the upstream network.
  
          Args:
              x (tuple[Tensor]): Features from the upstream network, each is
                  a 4D-tensor.
  
          Returns:
              tuple[list[Tensor], list[Tensor]]: A tuple of cls_scores list and
              bbox_preds list.
  
              - cls_scores (list[Tensor]): Classification scores for all scale \
              levels, each is a 4D-tensor, the channels number is \
              num_anchors * num_classes.
              - bbox_preds (list[Tensor]): Box energies / deltas for all scale \
              levels, each is a 4D-tensor, the channels number is \
              num_anchors * 4.
          """
      cls_scores = []
      bbox_preds = []
      for feat, reg_conv, cls_conv in zip(
          x, self.reg_convs, self.cls_convs
      ):
          cls_scores.append(cls_conv(feat))
          bbox_preds.append(reg_conv(feat))
      return cls_scores, bbox_preds
  
file_path: mmdetection/mmdet/models/dense_heads/ssd_head.py
imports: from typing import Dict, List, Optional, Sequence, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import ConvModule, DepthwiseSeparableConvModule
  from torch import Tensor
  from mmdet.registry import MODELS, TASK_UTILS
  from mmdet.utils import ConfigType, InstanceList, MultiConfig, OptInstanceList
  from ..losses import smooth_l1_loss
  from ..task_modules.samplers import PseudoSampler
  from ..utils import multi_apply
  from .anchor_head import AnchorHead
label_desc: Use image node_id 3 for calling the SSDHead obj's underlying member method code with example usage: obj.forward(x) and returns: cls_scores,  bbox_preds