class_docstr: More general bbox head, with shared conv and fc layers and two optional
  separated branches.
  
  .. code-block:: none
  
                                  /-> cls convs -> cls fcs -> cls
      shared convs -> shared fcs
                                  \-> reg convs -> reg fcs -> reg
class_docstr_tok: ["More","general","bbox","head",",","with","shared","conv","and","fc","layers","and","two","optional","separated","branches",".","..","code-block",":",":","none","\/-",">","cls","convs","-",">","cls","fcs","-",">","cls","shared","convs","-",">","shared","fcs","\\-",">","reg","convs","-",">","reg","fcs","-",">","reg"]
docstr: Forward features from the upstream network.
  
  Args:
      x (tuple[Tensor]): Features from the upstream network, each is
          a 4D-tensor.
  
  Returns:
      tuple: A tuple of classification scores and bbox prediction.
  
          - cls_score (Tensor): Classification scores for all                     scale levels, each is a 4D-tensor, the channels number                     is num_base_priors * num_classes.
          - bbox_pred (Tensor): Box energies / deltas for all                     scale levels, each is a 4D-tensor, the channels number                     is num_base_priors * 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",":","A","tuple","of","classification","scores","and","bbox","prediction",".","-","cls_score","(","Tensor",")",":","Classification","scores","for","all","scale","levels",",","each","is","a","4D-tensor",",","the","channels","number","is","num_base_priors","*","num_classes",".","-","bbox_pred","(","Tensor",")",":","Box","energies","\/","deltas","for","all","scale","levels",",","each","is","a","4D-tensor",",","the","channels","number","is","num_base_priors","*","4","."]
code: def forward(self, x: Tuple[Tensor]) -> tuple:
      """Forward features from the upstream network.
  
          Args:
              x (tuple[Tensor]): Features from the upstream network, each is
                  a 4D-tensor.
  
          Returns:
              tuple: A tuple of classification scores and bbox prediction.
  
                  - cls_score (Tensor): Classification scores for all \
                      scale levels, each is a 4D-tensor, the channels number \
                      is num_base_priors * num_classes.
                  - bbox_pred (Tensor): Box energies / deltas for all \
                      scale levels, each is a 4D-tensor, the channels number \
                      is num_base_priors * 4.
          """
      # shared part
      if self.num_shared_convs > 0:
          for conv in self.shared_convs:
              x = conv(x)
  
      if self.num_shared_fcs > 0:
          if self.with_avg_pool:
              x = self.avg_pool(x)
  
          x = x.flatten(1)
  
          for fc in self.shared_fcs:
              x = self.relu(fc(x))
      # separate branches
      x_cls = x
      x_reg = x
  
      for conv in self.cls_convs:
          x_cls = conv(x_cls)
      if x_cls.dim() > 2:
          if self.with_avg_pool:
              x_cls = self.avg_pool(x_cls)
          x_cls = x_cls.flatten(1)
      for fc in self.cls_fcs:
          x_cls = self.relu(fc(x_cls))
  
      for conv in self.reg_convs:
          x_reg = conv(x_reg)
      if x_reg.dim() > 2:
          if self.with_avg_pool:
              x_reg = self.avg_pool(x_reg)
          x_reg = x_reg.flatten(1)
      for fc in self.reg_fcs:
          x_reg = self.relu(fc(x_reg))
  
      cls_score = self.fc_cls(x_cls) if self.with_cls else None
      bbox_pred = self.fc_reg(x_reg) if self.with_reg else None
      return cls_score, bbox_pred
  
file_path: mmdetection/mmdet/models/roi_heads/bbox_heads/convfc_bbox_head.py
imports: from typing import Optional, Tuple, Union
  import torch.nn
  from mmcv.cnn import ConvModule
  from mmengine.config import ConfigDict
  from torch import Tensor
  from mmdet.registry import MODELS
  from .bbox_head import BBoxHead
label_desc: Use image node_id 3 for calling the ConvFCBBoxHead obj's underlying member method code with example usage: obj.forward(x) and returns: cls_score,  bbox_pred