code: def __init__(
      self,
      kernel_size: int,
      input_c: int,
      out_c: int,
      expand_ratio: int,
      stride: int,
      se_ratio: float,
      drop_rate: float,
      norm_layer: Callable[..., nn.Module],
  ):
      super(MBConv, self).__init__()
  
      if stride not in [1, 2]:
          raise ValueError("illegal stride value.")
  
      self.has_shortcut = stride == 1 and input_c == out_c
  
      activation_layer = nn.SiLU  # alias Swish
      expanded_c = input_c * expand_ratio
  
      # 在EfficientNetV2中，MBConv中不存在expansion=1的情况所以conv_pw肯定存在
      assert expand_ratio != 1
      # Point-wise expansion
      self.expand_conv = ConvBNAct(
          input_c,
          expanded_c,
          kernel_size=1,
          norm_layer=norm_layer,
          activation_layer=activation_layer,
      )
  
      # Depth-wise convolution
      self.dwconv = ConvBNAct(
          expanded_c,
          expanded_c,
          kernel_size=kernel_size,
          stride=stride,
          groups=expanded_c,
          norm_layer=norm_layer,
          activation_layer=activation_layer,
      )
  
      self.se = (
          SqueezeExcite(input_c, expanded_c, se_ratio)
          if se_ratio > 0
          else nn.Identity()
      )
  
      # Point-wise linear projection
      self.project_conv = ConvBNAct(
          expanded_c,
          out_planes=out_c,
          kernel_size=1,
          norm_layer=norm_layer,
          activation_layer=nn.Identity,
      )  # 注意这里没有激活函数，所有传入Identity
  
      self.out_channels = out_c
  
      # 只有在使用shortcut连接时才使用dropout层
      self.drop_rate = drop_rate
      if self.has_shortcut and drop_rate > 0:
          self.dropout = DropPath(drop_rate)
  
imports: from collections import OrderedDict
  from functools import partial
  from typing import Callable, Optional
  import torch.nn
  import torch
  from torch import Tensor
label_desc: Use image node_id 1 to create a new MBConv object from inherited base classes: nn with example: obj = MBConv(kernel_size, input_c, out_c, expand_ratio, stride, se_ratio, drop_rate, norm_layer)