class_docstr: Inverted Residual unit.
code: def __init__(
      self,
      num_channels: int,
      num_filters: int,
      stride: int,
      benchmodel: int,
      act: str = "relu",
      name: str = None,
  ):
      super(InvertedResidualUnit, self).__init__()
      assert stride in [
          1,
          2,
      ], "supported stride are {} but your stride is {}".format(
          [1, 2], stride
      )
      self.benchmodel = benchmodel
      oup_inc = num_filters // 2
      inp = num_channels
      if benchmodel == 1:
          self._conv_pw = ConvBNLayer(
              num_channels=num_channels // 2,
              num_filters=oup_inc,
              filter_size=1,
              stride=1,
              padding=0,
              num_groups=1,
              if_act=True,
              act=act,
              name="stage_" + name + "_conv1",
          )
          self._conv_dw = ConvBNLayer(
              num_channels=oup_inc,
              num_filters=oup_inc,
              filter_size=3,
              stride=stride,
              padding=1,
              num_groups=oup_inc,
              if_act=False,
              act=act,
              name="stage_" + name + "_conv2",
          )
          self._conv_linear = ConvBNLayer(
              num_channels=oup_inc,
              num_filters=oup_inc,
              filter_size=1,
              stride=1,
              padding=0,
              num_groups=1,
              if_act=True,
              act=act,
              name="stage_" + name + "_conv3",
          )
      else:
          # branch1
          self._conv_dw_1 = ConvBNLayer(
              num_channels=num_channels,
              num_filters=inp,
              filter_size=3,
              stride=stride,
              padding=1,
              num_groups=inp,
              if_act=False,
              act=act,
              name="stage_" + name + "_conv4",
          )
          self._conv_linear_1 = ConvBNLayer(
              num_channels=inp,
              num_filters=oup_inc,
              filter_size=1,
              stride=1,
              padding=0,
              num_groups=1,
              if_act=True,
              act=act,
              name="stage_" + name + "_conv5",
          )
          # branch2
          self._conv_pw_2 = ConvBNLayer(
              num_channels=num_channels,
              num_filters=oup_inc,
              filter_size=1,
              stride=1,
              padding=0,
              num_groups=1,
              if_act=True,
              act=act,
              name="stage_" + name + "_conv1",
          )
          self._conv_dw_2 = ConvBNLayer(
              num_channels=oup_inc,
              num_filters=oup_inc,
              filter_size=3,
              stride=stride,
              padding=1,
              num_groups=oup_inc,
              if_act=False,
              act=act,
              name="stage_" + name + "_conv2",
          )
          self._conv_linear_2 = ConvBNLayer(
              num_channels=oup_inc,
              num_filters=oup_inc,
              filter_size=1,
              stride=1,
              padding=0,
              num_groups=1,
              if_act=True,
              act=act,
              name="stage_" + name + "_conv3",
          )
  
imports: import os
  import paddle
  from paddle import ParamAttr
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn import Conv2d, BatchNorm, Linear, Dropout
  from paddle.nn import AdaptiveAvgPool2d, MaxPool2d, AvgPool2d
  from paddle.nn.initializer import MSRA
  from paddlehub.module.module import moduleinfo
  from paddlehub.module.cv_module import ImageClassifierModule
label_desc: Use image node_id 1 to create a new InvertedResidualUnit object from inherited base classes: nn with example: obj = InvertedResidualUnit(num_channels, num_filters, stride, benchmodel, act, name)