code: def inverted_residual_choice_builder(
      expand_ratios: List[int],
      kernel_sizes: List[int],
      downsample: bool,
      stage_input_width: int,
      stage_output_width: int,
      label: str,
  ):
      def builder(index):
          stride = 1
          inp = stage_output_width
  
          if index == 0:
              # first layer in stage
              # do downsample and width reshape
              inp = stage_input_width
              if downsample:
                  stride = 2
  
          oup = stage_output_width
  
          op_choices = {}
          for exp_ratio in expand_ratios:
              for kernel_size in kernel_sizes:
                  op_choices[
                      f"k{kernel_size}e{exp_ratio}"
                  ] = InvertedResidual(
                      inp, oup, exp_ratio, kernel_size, stride
                  )
  
          # It can be implemented with ValueChoice, but we use LayerChoice here
          # to be aligned with the intention of the original ProxylessNAS.
          return LayerChoice(op_choices, label=f"{label}_i{index}")
  
      return builder
  
imports: import math
  from typing import Optional, Callable, List, Tuple, Iterator, Union, cast, overload
  import torch
  from torch import nn
  from nni.mutable import MutableExpression
  from nni.nas.nn.pytorch import ModelSpace, LayerChoice, Repeat, MutableConv2d, MutableLinear, MutableBatchNorm2d
  from .utils.pretrained import load_pretrained_weight
label_desc: Use image node_id 5 for calling a global function with example usage: inverted_residual_choice_builder(expand_ratios, kernel_sizes, downsample, stage_input_width, stage_output_width, label) and returns: builder, LayerChoice