class_docstr: Inverted residual block w/ optional SE and CondConv routing
code: def __init__(
      self,
      in_chs,
      out_chs,
      dw_kernel_size=3,
      stride=1,
      dilation=1,
      pad_type="",
      act_layer=nn.ReLU,
      noskip=False,
      exp_ratio=1.0,
      exp_kernel_size=1,
      pw_kernel_size=1,
      se_ratio=0.0,
      se_kwargs=None,
      norm_layer=nn.BatchNorm2d,
      norm_kwargs=None,
      conv_kwargs=None,
      drop_path_rate=0.0,
  ):
      super(InvertedResidual, self).__init__()
      norm_kwargs = norm_kwargs or {}
      conv_kwargs = conv_kwargs or {}
      mid_chs = make_divisible(in_chs * exp_ratio)
      has_se = se_ratio is not None and se_ratio > 0.0
      self.has_residual = (
          in_chs == out_chs and stride == 1
      ) and not noskip
      self.drop_path_rate = drop_path_rate
  
      # Point-wise expansion
      self.conv_pw = create_conv2d(
          in_chs,
          mid_chs,
          exp_kernel_size,
          padding=pad_type,
          **conv_kwargs,
      )
      self.bn1 = norm_layer(mid_chs, **norm_kwargs)
      self.act1 = act_layer(inplace=True)
  
      # Depth-wise convolution
      self.conv_dw = create_conv2d(
          mid_chs,
          mid_chs,
          dw_kernel_size,
          stride=stride,
          dilation=dilation,
          padding=pad_type,
          depthwise=True,
          **conv_kwargs,
      )
      self.bn2 = norm_layer(mid_chs, **norm_kwargs)
      self.act2 = act_layer(inplace=True)
  
      # Squeeze-and-excitation
      if has_se:
          se_kwargs = resolve_se_args(se_kwargs, in_chs, act_layer)
          self.se = SqueezeExcite(
              mid_chs, se_ratio=se_ratio, **se_kwargs
          )
      else:
          self.se = None
  
      # Point-wise linear projection
      self.conv_pwl = create_conv2d(
          mid_chs,
          out_chs,
          pw_kernel_size,
          padding=pad_type,
          **conv_kwargs,
      )
      self.bn3 = norm_layer(out_chs, **norm_kwargs)
  
file_path: nni/examples/nas/legacy/cream/lib/models/blocks/inverted_residual_block.py
imports: import torch.nn
  from timm.models.layers import create_conv2d
  from timm.models.efficientnet_blocks import make_divisible, resolve_se_args, SqueezeExcite, drop_path
label_desc: Use image node_id 1 to create a new InvertedResidual object from inherited base classes: nn with example: obj = InvertedResidual(in_chs, out_chs, dw_kernel_size, stride, dilation, pad_type, act_layer, noskip, exp_ratio, exp_kernel_size, pw_kernel_size, se_ratio, se_kwargs, norm_layer, norm_kwargs, conv_kwargs, drop_path_rate)