code: def __init__(
      self,
      key,
      prev_keys,
      hidden_units,
      choose_from_k,
      cnn_keep_prob,
      lstm_keep_prob,
      att_keep_prob,
      att_mask,
  ):
      super(Layer, self).__init__(key)
  
      def conv_shortcut(kernel_size):
          return ConvBN(
              kernel_size,
              hidden_units,
              hidden_units,
              cnn_keep_prob,
              False,
              True,
          )
  
      self.n_candidates = len(prev_keys)
      if self.n_candidates:
          self.prec = mutables.InputChoice(
              choose_from=prev_keys[-choose_from_k:], n_chosen=1
          )
      else:
          # first layer, skip input choice
          self.prec = None
      self.op = mutables.LayerChoice(
          [
              conv_shortcut(1),
              conv_shortcut(3),
              conv_shortcut(5),
              conv_shortcut(7),
              AvgPool(3, False, True),
              MaxPool(3, False, True),
              RNN(hidden_units, lstm_keep_prob),
              Attention(hidden_units, 4, att_keep_prob, att_mask),
          ]
      )
      if self.n_candidates:
          self.skipconnect = mutables.InputChoice(choose_from=prev_keys)
      else:
          self.skipconnect = None
      self.bn = BatchNorm(hidden_units, False, True)
  
file_path: nni/examples/nas/legacy/textnas/model.py
imports: import numpy
  import torch
  import torch.nn
  from nni.nas.pytorch import mutables
  from ops import ConvBN, LinearCombine, AvgPool, MaxPool, RNN, Attention, BatchNorm
  from utils import GlobalMaxPool, GlobalAvgPool
label_desc: Use image node_id 1 to create a new Layer object from inherited base classes: mutables with example: obj = Layer(key, prev_keys, hidden_units, choose_from_k, cnn_keep_prob, lstm_keep_prob, att_keep_prob, att_mask)