class_docstr: The quasi-dense roi embed head.
  
  Args:
      embed_channels (int): The input channel of embed features.
          Defaults to 256.
      softmax_temp (int): Softmax temperature. Defaults to -1.
      loss_track (dict): The loss function for tracking. Defaults to
          MultiPosCrossEntropyLoss.
      loss_track_aux (dict): The auxiliary loss function for tracking.
          Defaults to MarginL2Loss.
      init_cfg (:obj:`ConfigDict` or dict or list[:obj:`ConfigDict` or             dict]): Initialization config dict.
class_docstr_tok: ["The","quasi-dense","roi","embed","head",".","Args",":","embed_channels","(","int",")",":","The","input","channel","of","embed","features",".","Defaults","to","256.","softmax_temp","(","int",")",":","Softmax","temperature",".","Defaults","to","-1.","loss_track","(","dict",")",":","The","loss","function","for","tracking",".","Defaults","to","MultiPosCrossEntropyLoss",".","loss_track_aux","(","dict",")",":","The","auxiliary","loss","function","for","tracking",".","Defaults","to","MarginL2Loss",".","init_cfg","(",":","obj",":","`","ConfigDict","`","or","dict","or","list","[",":","obj",":","`","ConfigDict","`","or","dict","]",")",":","Initialization","config","dict","."]
docstr: Add shared or separable branch. convs -> avg pool (optional) -> fcs.
  
  Args:
      num_branch_convs (int): The number of convoluational layers.
      num_branch_fcs (int): The number of fully connection layers.
      in_channels (int): The input channel of roi features.
  
  Returns:
      Tuple[nn.ModuleList, nn.ModuleList, int]: The convs, fcs and the
          last layer dimension.
docstr_tok: ["Add","shared","or","separable","branch",".","convs","-",">","avg","pool","(","optional",")","-",">","fcs",".","Args",":","num_branch_convs","(","int",")",":","The","number","of","convoluational","layers",".","num_branch_fcs","(","int",")",":","The","number","of","fully","connection","layers",".","in_channels","(","int",")",":","The","input","channel","of","roi","features",".","Returns",":","Tuple","[","nn.ModuleList",",","nn.ModuleList",",","int","]",":","The","convs",",","fcs","and","the","last","layer","dimension","."]
code: def _add_conv_fc_branch(
      self, num_branch_convs: int, num_branch_fcs: int, in_channels: int
  ) -> Tuple[nn.ModuleList, nn.ModuleList, int]:
      """Add shared or separable branch. convs -> avg pool (optional) -> fcs.
  
      Args:
          num_branch_convs (int): The number of convoluational layers.
          num_branch_fcs (int): The number of fully connection layers.
          in_channels (int): The input channel of roi features.
  
      Returns:
          Tuple[nn.ModuleList, nn.ModuleList, int]: The convs, fcs and the
              last layer dimension.
      """
      last_layer_dim = in_channels
      # add branch specific conv layers
      branch_convs = nn.ModuleList()
      if num_branch_convs > 0:
          for i in range(num_branch_convs):
              conv_in_channels = (
                  last_layer_dim if i == 0 else self.conv_out_channels
              )
              branch_convs.append(
                  ConvModule(
                      conv_in_channels,
                      self.conv_out_channels,
                      3,
                      padding=1,
                      conv_cfg=self.conv_cfg,
                      norm_cfg=self.norm_cfg,
                  )
              )
          last_layer_dim = self.conv_out_channels
  
      # add branch specific fc layers
      branch_fcs = nn.ModuleList()
      if num_branch_fcs > 0:
          if not self.with_avg_pool:
              last_layer_dim *= self.roi_feat_area
          for i in range(num_branch_fcs):
              fc_in_channels = (
                  last_layer_dim if i == 0 else self.fc_out_channels
              )
              branch_fcs.append(
                  nn.Linear(fc_in_channels, self.fc_out_channels)
              )
          last_layer_dim = self.fc_out_channels
  
      return branch_convs, branch_fcs, last_layer_dim
  
file_path: mmdetection/mmdet/models/tracking_heads/quasi_dense_embed_head.py
imports: from typing import List, Optional, Tuple
  import torch
  import torch.nn
  from mmcv.cnn import ConvModule
  from mmengine.model import BaseModule
  from torch import Tensor
  from torch.nn.modules.utils import _pair
  from mmdet.models.task_modules import SamplingResult
  from mmdet.registry import MODELS
  from ..task_modules.tracking import embed_similarity
label_desc: Use image node_id 2 for calling the QuasiDenseEmbedHead obj's underlying member method code with example usage: obj._add_conv_fc_branch(num_branch_convs, num_branch_fcs, in_channels) and returns: branch_convs,  branch_fcs,  last_layer_dim