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","."]
code: def __init__(
      self,
      in_channels: int,
      out_channels: int,
      expansion: float = 0.5,
      add_identity: bool = True,
      use_depthwise: bool = False,
      kernel_size: int = 5,
      conv_cfg: OptConfigType = None,
      norm_cfg: ConfigType = dict(type="BN", momentum=0.03, eps=0.001),
      act_cfg: ConfigType = dict(type="SiLU"),
      init_cfg: OptMultiConfig = None,
  ) -> None:
      super().__init__(init_cfg=init_cfg)
      hidden_channels = int(out_channels * expansion)
      conv = (
          DepthwiseSeparableConvModule if use_depthwise else ConvModule
      )
      self.conv1 = conv(
          in_channels,
          hidden_channels,
          3,
          stride=1,
          padding=1,
          norm_cfg=norm_cfg,
          act_cfg=act_cfg,
      )
      self.conv2 = DepthwiseSeparableConvModule(
          hidden_channels,
          out_channels,
          kernel_size,
          stride=1,
          padding=kernel_size // 2,
          conv_cfg=conv_cfg,
          norm_cfg=norm_cfg,
          act_cfg=act_cfg,
      )
      self.add_identity = add_identity and in_channels == out_channels
  
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 1 to create a new CSPNeXtBlock object from inherited base classes: BaseModule with example: obj = CSPNeXtBlock(in_channels, out_channels, expansion, add_identity, use_depthwise, kernel_size, conv_cfg, norm_cfg, act_cfg, init_cfg)