class_docstr: The basic bottleneck block used in CSPNeXt.
  
  Args:
      in_channels (int): The input channels of this Module.
      out_channels (int): The output channels of this Module.
      expansion (float): Expand ratio of the hidden channel. Defaults to 0.5.
      add_identity (bool): Whether to add identity to the out. Only works
          when in_channels == out_channels. Defaults to True.
      use_depthwise (bool): Whether to use depthwise separable convolution.
          Defaults to False.
      kernel_size (int): The kernel size of the second convolution layer.
          Defaults to 5.
      conv_cfg (dict): Config dict for convolution layer. Defaults to None,
          which means using conv2d.
      norm_cfg (dict): Config dict for normalization layer.
          Defaults to dict(type='BN', momentum=0.03, eps=0.001).
      act_cfg (dict): Config dict for activation layer.
          Defaults to dict(type='SiLU').
      init_cfg (:obj:`ConfigDict` or dict or list[dict] or
          list[:obj:`ConfigDict`], optional): Initialization config dict.
          Defaults to None.
class_docstr_tok: ["The","basic","bottleneck","block","used","in","CSPNeXt",".","Args",":","in_channels","(","int",")",":","The","input","channels","of","this","Module",".","out_channels","(","int",")",":","The","output","channels","of","this","Module",".","expansion","(","float",")",":","Expand","ratio","of","the","hidden","channel",".","Defaults","to","0.5.","add_identity","(","bool",")",":","Whether","to","add","identity","to","the","out",".","Only","works","when","in_channels","==","out_channels",".","Defaults","to","True",".","use_depthwise","(","bool",")",":","Whether","to","use","depthwise","separable","convolution",".","Defaults","to","False",".","kernel_size","(","int",")",":","The","kernel","size","of","the","second","convolution","layer",".","Defaults","to","5.","conv_cfg","(","dict",")",":","Config","dict","for","convolution","layer",".","Defaults","to","None",",","which","means","using","conv2d",".","norm_cfg","(","dict",")",":","Config","dict","for","normalization","layer",".","Defaults","to","dict","(","type='BN","'",",","momentum=0.03",",","eps=0.001",")",".","act_cfg","(","dict",")",":","Config","dict","for","activation","layer",".","Defaults","to","dict","(","type='SiLU","'",")",".","init_cfg","(",":","obj",":","`","ConfigDict","`","or","dict","or","list","[","dict","]","or","list","[",":","obj",":","`","ConfigDict","`","]",",","optional",")",":","Initialization","config","dict",".","Defaults","to","None","."]
docstr: Forward function.
docstr_tok: ["Forward","function","."]
code: def forward(self, x: Tensor) -> Tensor:
      """Forward function."""
      identity = x
      out = self.conv1(x)
      out = self.conv2(out)
  
      if self.add_identity:
          return out + identity
      else:
          return out
  
file_path: mmdetection/mmdet/models/layers/csp_layer.py
imports: import torch
  import torch.nn
  from mmcv.cnn import ConvModule, DepthwiseSeparableConvModule
  from mmengine.model import BaseModule
  from torch import Tensor
  from mmdet.utils import ConfigType, OptConfigType, OptMultiConfig
  from .se_layer import ChannelAttention
label_desc: Use image node_id 2 for calling the CSPNeXtBlock obj's underlying member method code with example usage: obj.forward(x) and returns: unknown, out