code: def __init__(
      self,
      embedding,
      hidden_units=256,
      num_layers=24,
      num_classes=5,
      choose_from_k=5,
      lstm_keep_prob=0.5,
      cnn_keep_prob=0.5,
      att_keep_prob=0.5,
      att_mask=True,
      embed_keep_prob=0.5,
      final_output_keep_prob=1.0,
      global_pool="avg",
  ):
      super(Model, self).__init__()
  
      self.embedding = nn.Embedding.from_pretrained(
          embedding, freeze=False
      )
      self.hidden_units = hidden_units
      self.num_layers = num_layers
      self.num_classes = num_classes
  
      self.init_conv = ConvBN(
          1,
          self.embedding.embedding_dim,
          hidden_units,
          cnn_keep_prob,
          False,
          True,
      )
  
      self.layers = nn.ModuleList()
      candidate_keys_pool = []
      for layer_id in range(self.num_layers):
          k = "layer_{}".format(layer_id)
          self.layers.append(
              Layer(
                  k,
                  candidate_keys_pool,
                  hidden_units,
                  choose_from_k,
                  cnn_keep_prob,
                  lstm_keep_prob,
                  att_keep_prob,
                  att_mask,
              )
          )
          candidate_keys_pool.append(k)
  
      self.linear_combine = LinearCombine(self.num_layers)
      self.linear_out = nn.Linear(self.hidden_units, self.num_classes)
  
      self.embed_dropout = nn.Dropout(p=1 - embed_keep_prob)
      self.output_dropout = nn.Dropout(p=1 - final_output_keep_prob)
  
      assert global_pool in ["max", "avg"]
      if global_pool == "max":
          self.global_pool = GlobalMaxPool()
      elif global_pool == "avg":
          self.global_pool = GlobalAvgPool()
  
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 Model object from inherited base classes: nn with example: obj = Model(embedding, hidden_units, num_layers, num_classes, choose_from_k, lstm_keep_prob, cnn_keep_prob, att_keep_prob, att_mask, embed_keep_prob, final_output_keep_prob, global_pool)