code: def __init__(
      self,
      input_size,
      in_channels,
      channels,
      n_classes,
      n_layers,
      n_nodes=4,
      stem_multiplier=3,
      auxiliary=False,
  ):
      super().__init__()
      self.in_channels = in_channels
      self.channels = channels
      self.n_classes = n_classes
      self.n_layers = n_layers
      self.aux_pos = 2 * n_layers // 3 if auxiliary else -1
  
      c_cur = stem_multiplier * self.channels
      self.stem = nn.Sequential(
          nn.Conv2d(in_channels, c_cur, 3, 1, 1, bias=False),
          nn.BatchNorm2d(c_cur),
      )
  
      # for the first cell, stem is used for both s0 and s1
      # [!] channels_pp and channels_p is output channel size, but c_cur is input channel size.
      channels_pp, channels_p, c_cur = c_cur, c_cur, channels
  
      self.cells = nn.ModuleList()
      reduction_p, reduction = False, False
      for i in range(n_layers):
          reduction_p, reduction = reduction, False
          # Reduce featuremap size and double channels in 1/3 and 2/3 layer.
          if i in [n_layers // 3, 2 * n_layers // 3]:
              c_cur *= 2
              reduction = True
  
          cell = Cell(
              n_nodes,
              channels_pp,
              channels_p,
              c_cur,
              reduction_p,
              reduction,
          )
          self.cells.append(cell)
          c_cur_out = c_cur * n_nodes
          channels_pp, channels_p = channels_p, c_cur_out
  
          if i == self.aux_pos:
              self.aux_head = AuxiliaryHead(
                  input_size // 4, channels_p, n_classes
              )
  
      self.gap = nn.AdaptiveAvgPool2d(1)
      self.linear = nn.Linear(channels_p, n_classes)
  
imports: from collections import OrderedDict
  import torch
  import torch.nn
  import ops
  from nni.retiarii.nn.pytorch import LayerChoice, InputChoice
label_desc: Use image node_id 1 to create a new CNN object from inherited base classes: nn with example: obj = CNN(input_size, in_channels, channels, n_classes, n_layers, n_nodes, stem_multiplier, auxiliary)