code: def __init__(
      self,
      in_channels,
      out_channels,
      stride,
      expand_ratio,
      norm_layer=nn.BatchNorm2d,
      **kwargs,
  ):
      super(InvertedResidual, self).__init__()
      if stride not in [1, 2]:
          raise AssertionError
      self.use_res_connect = stride == 1 and in_channels == out_channels
  
      layers = []
      inter_channels = int(round(in_channels * expand_ratio))
      if expand_ratio != 1:
          # pw
          layers.append(
              _ConvBNReLU(
                  in_channels,
                  inter_channels,
                  1,
                  relu6=True,
                  norm_layer=norm_layer,
              )
          )
      layers.extend(
          [
              # dw
              _ConvBNReLU(
                  inter_channels,
                  inter_channels,
                  3,
                  stride,
                  1,
                  groups=inter_channels,
                  relu6=True,
                  norm_layer=norm_layer,
              ),
              # pw-linear
              nn.Conv2d(inter_channels, out_channels, 1, bias=False),
              norm_layer(out_channels),
          ]
      )
      self.conv = nn.Sequential(*layers)
  
imports: import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new InvertedResidual object from inherited base classes: nn with example: obj = InvertedResidual(in_channels, out_channels, stride, expand_ratio, norm_layer)