class_docstr: Inverted Residual Block.
  
  Args:
      in_channels (int): The input channels of this Module.
      out_channels (int): The output channels of this Module.
      mid_channels (int): The input channels of the depthwise convolution.
      kernel_size (int): The kernel size of the depthwise convolution.
          Default: 3.
      stride (int): The stride of the depthwise convolution. Default: 1.
      se_cfg (dict): Config dict for se layer. Default: None, which means no
          se layer.
      with_expand_conv (bool): Use expand conv or not. If set False,
          mid_channels must be the same with in_channels.
          Default: True.
      conv_cfg (dict): Config dict for convolution layer. Default: None,
          which means using conv2d.
      norm_cfg (dict): Config dict for normalization layer.
          Default: dict(type='BN').
      act_cfg (dict): Config dict for activation layer.
          Default: dict(type='ReLU').
      drop_path_rate (float): stochastic depth rate. Defaults to 0.
      with_cp (bool): Use checkpoint or not. Using checkpoint will save some
          memory while slowing down the training speed. Default: False.
      init_cfg (dict or list[dict], optional): Initialization config dict.
          Default: None
  
  Returns:
      Tensor: The output tensor.
code: def forward(self, x):
      def _inner_forward(x):
          out = x
  
          if self.with_expand_conv:
              out = self.expand_conv(out)
  
          out = self.depthwise_conv(out)
  
          if self.with_se:
              out = self.se(out)
  
          out = self.linear_conv(out)
  
          if self.with_res_shortcut:
              return x + self.drop_path(out)
          else:
              return out
  
      if self.with_cp and x.requires_grad:
          out = cp.checkpoint(_inner_forward, x)
      else:
          out = _inner_forward(x)
  
      return out
  
file_path: mmdetection/mmdet/models/layers/inverted_residual.py
imports: import torch.nn
  import torch.utils.checkpoint
  from mmcv.cnn import ConvModule
  from mmcv.cnn.bricks import DropPath
  from mmengine.model import BaseModule
  from .se_layer import SELayer
label_desc: Use image node_id 2 for calling the InvertedResidual obj's underlying member method code with example usage: obj.forward(x) and returns: out, unknown, out