class_docstr: Based on
  https://github.com/pytorch/examples/blob/master/word_language_model/model.py
  
  TODO(brendan): RL controllers do not necessarily have much to do with
  language models.
  
  Base the controller RNN on the GRU from:
  https://github.com/ikostrikov/pytorch-a2c-ppo-acktr/blob/master/model.py
code: def __init__(self, args):
      torch.nn.Module.__init__(self)
      self.args = args
  
      if self.args.network_type == "rnn":
          # NOTE(brendan): `num_tokens` here is just the activation function
          # for every even step,
          self.num_tokens = [len(args.shared_rnn_activations)]
          for idx in range(self.args.num_blocks):
              self.num_tokens += [
                  idx + 1,
                  len(args.shared_rnn_activations),
              ]
          self.func_names = args.shared_rnn_activations
      elif self.args.network_type == "cnn":
          self.num_tokens = [
              len(args.shared_cnn_types),
              self.args.num_blocks,
          ]
          self.func_names = args.shared_cnn_types
  
      num_total_tokens = sum(self.num_tokens)
  
      self.encoder = torch.nn.Embedding(
          num_total_tokens, args.controller_hid
      )
      self.lstm = torch.nn.LSTMCell(
          args.controller_hid, args.controller_hid
      )
  
      # TODO(brendan): Perhaps these weights in the decoder should be
      # shared? At least for the activation functions, which all have the
      # same size.
      self.decoders = []
      for idx, size in enumerate(self.num_tokens):
          decoder = torch.nn.Linear(args.controller_hid, size)
          self.decoders.append(decoder)
  
      self._decoders = torch.nn.ModuleList(self.decoders)
  
      self.reset_parameters()
      self.static_init_hidden = utils.keydefaultdict(self.init_hidden)
  
      def _get_default_hidden(key):
          return utils.get_variable(
              torch.zeros(key, self.args.controller_hid),
              self.args.cuda,
              requires_grad=False,
          )
  
      self.static_inputs = utils.keydefaultdict(_get_default_hidden)
  
file_path: ENAS-pytorch/models/controller.py
imports: import collections
  import os
  import torch
  import torch.nn.functional
  import utils
  from utils import Node
label_desc: Use image node_id 1 to create a new Controller object from inherited base classes: torch.nn with example: obj = Controller(args)