class_docstr: The basic bottleneck block used in Darknet.
  
  Each ResBlock consists of two ConvModules and the input is added to the
  final output. Each ConvModule is composed of Conv, BN, and LeakyReLU.
  The first convLayer has filter size of 1x1 and the second one has the
  filter size of 3x3.
  
  Args:
      in_channels (int): The input channels of this Module.
      out_channels (int): The output channels of this Module.
      expansion (float): The kernel size of the convolution.
          Defaults to 0.5.
      add_identity (bool): Whether to add identity to the out.
          Defaults to True.
      use_depthwise (bool): Whether to use depthwise separable convolution.
          Defaults to False.
      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').
      act_cfg (dict): Config dict for activation layer.
          Defaults to dict(type='Swish').
class_docstr_tok: ["The","basic","bottleneck","block","used","in","Darknet",".","Each","ResBlock","consists","of","two","ConvModules","and","the","input","is","added","to","the","final","output",".","Each","ConvModule","is","composed","of","Conv",",","BN",",","and","LeakyReLU",".","The","first","convLayer","has","filter","size","of","1x1","and","the","second","one","has","the","filter","size","of","3x3",".","Args",":","in_channels","(","int",")",":","The","input","channels","of","this","Module",".","out_channels","(","int",")",":","The","output","channels","of","this","Module",".","expansion","(","float",")",":","The","kernel","size","of","the","convolution",".","Defaults","to","0.5.","add_identity","(","bool",")",":","Whether","to","add","identity","to","the","out",".","Defaults","to","True",".","use_depthwise","(","bool",")",":","Whether","to","use","depthwise","separable","convolution",".","Defaults","to","False",".","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","'",")",".","act_cfg","(","dict",")",":","Config","dict","for","activation","layer",".","Defaults","to","dict","(","type='Swish","'",")","."]
code: def __init__(
      self,
      in_channels: int,
      out_channels: int,
      expansion: float = 0.5,
      add_identity: bool = True,
      use_depthwise: bool = False,
      conv_cfg: OptConfigType = None,
      norm_cfg: ConfigType = dict(type="BN", momentum=0.03, eps=0.001),
      act_cfg: ConfigType = dict(type="Swish"),
      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 = ConvModule(
          in_channels,
          hidden_channels,
          1,
          conv_cfg=conv_cfg,
          norm_cfg=norm_cfg,
          act_cfg=act_cfg,
      )
      self.conv2 = conv(
          hidden_channels,
          out_channels,
          3,
          stride=1,
          padding=1,
          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 DarknetBottleneck object from inherited base classes: BaseModule with example: obj = DarknetBottleneck(in_channels, out_channels, expansion, add_identity, use_depthwise, conv_cfg, norm_cfg, act_cfg, init_cfg)