code: def __init__(self, inp, oup, stride, expand_ratio):
      super(InvertedResidual, self).__init__()
      self.stride = stride
      assert stride in [1, 2]
  
      hidden_dim = int(round(inp * expand_ratio))
      self.use_res_connect = self.stride == 1 and inp == oup
  
      layers = []
      if expand_ratio != 1:
          # pw
          layers.append(ConvBNReLU(inp, hidden_dim, kernel_size=1))
      layers.extend(
          [
              # dw
              ConvBNReLU(
                  hidden_dim,
                  hidden_dim,
                  stride=stride,
                  groups=hidden_dim,
              ),
              # pw-linear
              nn.Conv2d(hidden_dim, oup, 1, 1, 0, bias=False),
              nn.BatchNorm2d(oup),
          ]
      )
      self.conv = nn.Sequential(*layers)
  
imports: import os
  import sys
  import torch
  import torch.nn
  import torch.utils.model_zoo
  from torch.nn import functional
label_desc: Use image node_id 1 to create a new InvertedResidual object from inherited base classes: nn with example: obj = InvertedResidual(inp, oup, stride, expand_ratio)