code: def __init__(self, input_c: int, output_c: int, stride: int):
      super(InvertedResidual, self).__init__()
  
      if stride not in [1, 2]:
          raise ValueError("illegal stride value.")
      self.stride = stride
  
      assert output_c % 2 == 0
      branch_features = output_c // 2
      # 当stride为1时，input_channel应该是branch_features的两倍
      # python中 '<<' 是位运算，可理解为计算×2的快速方法
      assert (self.stride != 1) or (input_c == branch_features << 1)
  
      if self.stride == 2:
          self.branch1 = nn.Sequential(
              self.depthwise_conv(
                  input_c,
                  input_c,
                  kernel_s=3,
                  stride=self.stride,
                  padding=1,
              ),
              nn.BatchNorm2d(input_c),
              nn.Conv2d(
                  input_c,
                  branch_features,
                  kernel_size=1,
                  stride=1,
                  padding=0,
                  bias=False,
              ),
              nn.BatchNorm2d(branch_features),
              nn.ReLU(inplace=True),
          )
      else:
          self.branch1 = nn.Sequential()
  
      self.branch2 = nn.Sequential(
          nn.Conv2d(
              input_c if self.stride > 1 else branch_features,
              branch_features,
              kernel_size=1,
              stride=1,
              padding=0,
              bias=False,
          ),
          nn.BatchNorm2d(branch_features),
          nn.ReLU(inplace=True),
          self.depthwise_conv(
              branch_features,
              branch_features,
              kernel_s=3,
              stride=self.stride,
              padding=1,
          ),
          nn.BatchNorm2d(branch_features),
          nn.Conv2d(
              branch_features,
              branch_features,
              kernel_size=1,
              stride=1,
              padding=0,
              bias=False,
          ),
          nn.BatchNorm2d(branch_features),
          nn.ReLU(inplace=True),
      )
  
file_path: deep-learning-for-image-processing/pytorch_classification/mini_imagenet/model.py
imports: from typing import List, Callable
  import torch
  from torch import Tensor
  import torch.nn
label_desc: Use image node_id 1 to create a new InvertedResidual object from inherited base classes: nn with example: obj = InvertedResidual(input_c, output_c, stride)