parameters: (self, inputs, state)
return_statement: return new_m, new_state
docstring: Run one step of NAS Cell.
  
      Args:
        inputs: input Tensor, 2D, batch x num_units.
        state: This must be a tuple of state Tensors, both `2-D`, with column
          sizes `c_state` and `m_state`.
  
      Returns:
        A tuple containing:
        - A `2-D, [batch x output_dim]`, Tensor representing the output of the
          NAS Cell after reading `inputs` when previous state was `state`.
          Here output_dim is:
             num_proj if num_proj was set,
             num_units otherwise.
        - Tensor(s) representing the new state of NAS Cell after reading `inputs`
          when the previous state was `state`.  Same type and shape(s) as `state`.
  
      Raises:
        ValueError: If input size cannot be inferred from inputs via
          static shape inference.
docstring_summary: Run one step of NAS Cell.
docstring_tokens: Run one step of NAS Cell .
function: def call(self, inputs, state):
      """Run one step of NAS Cell.
  
      Args:
        inputs: input Tensor, 2D, batch x num_units.
        state: This must be a tuple of state Tensors, both `2-D`, with column
          sizes `c_state` and `m_state`.
  
      Returns:
        A tuple containing:
        - A `2-D, [batch x output_dim]`, Tensor representing the output of the
          NAS Cell after reading `inputs` when previous state was `state`.
          Here output_dim is:
             num_proj if num_proj was set,
             num_units otherwise.
        - Tensor(s) representing the new state of NAS Cell after reading `inputs`
          when the previous state was `state`.  Same type and shape(s) as `state`.
  
      Raises:
        ValueError: If input size cannot be inferred from inputs via
          static shape inference.
      """
      sigmoid = math_ops.sigmoid
      tanh = math_ops.tanh
      relu = nn_ops.relu
  
      num_proj = self._num_units if self._num_proj is None else self._num_proj
  
      (c_prev, m_prev) = state
  
      dtype = inputs.dtype
      input_size = inputs.get_shape().with_rank(2)[1]
      if input_size.value is None:
        raise ValueError("Could not infer input size from inputs.get_shape()[-1]")
      # Variables for the NAS cell. W_m is all matrices multiplying the
      # hiddenstate and W_inputs is all matrices multiplying the inputs.
      concat_w_m = vs.get_variable(
          "recurrent_kernel", [num_proj, 8 * self._num_units],
          dtype)
      concat_w_inputs = vs.get_variable(
          "kernel", [input_size.value, 8 * self._num_units],
          dtype)
  
      m_matrix = math_ops.matmul(m_prev, concat_w_m)
      inputs_matrix = math_ops.matmul(inputs, concat_w_inputs)
  
      if self._use_biases:
        b = vs.get_variable(
            "bias",
            shape=[8 * self._num_units],
            initializer=init_ops.zeros_initializer(),
            dtype=dtype)
        m_matrix = nn_ops.bias_add(m_matrix, b)
  
      # The NAS cell branches into 8 different splits for both the hiddenstate
      # and the input
      m_matrix_splits = array_ops.split(axis=1, num_or_size_splits=8,
                                        value=m_matrix)
      inputs_matrix_splits = array_ops.split(axis=1, num_or_size_splits=8,
                                             value=inputs_matrix)
  
      # First layer
      layer1_0 = sigmoid(inputs_matrix_splits[0] + m_matrix_splits[0])
      layer1_1 = relu(inputs_matrix_splits[1] + m_matrix_splits[1])
      layer1_2 = sigmoid(inputs_matrix_splits[2] + m_matrix_splits[2])
      layer1_3 = relu(inputs_matrix_splits[3] * m_matrix_splits[3])
      layer1_4 = tanh(inputs_matrix_splits[4] + m_matrix_splits[4])
      layer1_5 = sigmoid(inputs_matrix_splits[5] + m_matrix_splits[5])
      layer1_6 = tanh(inputs_matrix_splits[6] + m_matrix_splits[6])
      layer1_7 = sigmoid(inputs_matrix_splits[7] + m_matrix_splits[7])
  
      # Second layer
      l2_0 = tanh(layer1_0 * layer1_1)
      l2_1 = tanh(layer1_2 + layer1_3)
      l2_2 = tanh(layer1_4 * layer1_5)
      l2_3 = sigmoid(layer1_6 + layer1_7)
  
      # Inject the cell
      l2_0 = tanh(l2_0 + c_prev)
  
      # Third layer
      l3_0_pre = l2_0 * l2_1
      new_c = l3_0_pre  # create new cell
      l3_0 = l3_0_pre
      l3_1 = tanh(l2_2 + l2_3)
  
      # Final layer
      new_m = tanh(l3_0 * l3_1)
  
      # Projection layer if specified
      if self._num_proj is not None:
        concat_w_proj = vs.get_variable(
            "projection_weights", [self._num_units, self._num_proj],
            dtype)
        new_m = math_ops.matmul(new_m, concat_w_proj)
  
      new_state = rnn_cell_impl.LSTMStateTuple(new_c, new_m)
      return new_m, new_state
function_tokens: def call ( self , inputs , state ) : sigmoid = math_ops . sigmoid tanh = math_ops . tanh relu = nn_ops . relu num_proj = self . _num_units if self . _num_proj is None else self . _num_proj ( c_prev , m_prev ) = state dtype = inputs . dtype input_size = inputs . get_shape ( ) . with_rank ( 2 ) [ 1 ] if input_size . value is None : raise ValueError ( "Could not infer input size from inputs.get_shape()[-1]" ) # Variables for the NAS cell. W_m is all matrices multiplying the # hiddenstate and W_inputs is all matrices multiplying the inputs. concat_w_m = vs . get_variable ( "recurrent_kernel" , [ num_proj , 8 * self . _num_units ] , dtype ) concat_w_inputs = vs . get_variable ( "kernel" , [ input_size . value , 8 * self . _num_units ] , dtype ) m_matrix = math_ops . matmul ( m_prev , concat_w_m ) inputs_matrix = math_ops . matmul ( inputs , concat_w_inputs ) if self . _use_biases : b = vs . get_variable ( "bias" , shape = [ 8 * self . _num_units ] , initializer = init_ops . zeros_initializer ( ) , dtype = dtype ) m_matrix = nn_ops . bias_add ( m_matrix , b ) # The NAS cell branches into 8 different splits for both the hiddenstate # and the input m_matrix_splits = array_ops . split ( axis = 1 , num_or_size_splits = 8 , value = m_matrix ) inputs_matrix_splits = array_ops . split ( axis = 1 , num_or_size_splits = 8 , value = inputs_matrix ) # First layer layer1_0 = sigmoid ( inputs_matrix_splits [ 0 ] + m_matrix_splits [ 0 ] ) layer1_1 = relu ( inputs_matrix_splits [ 1 ] + m_matrix_splits [ 1 ] ) layer1_2 = sigmoid ( inputs_matrix_splits [ 2 ] + m_matrix_splits [ 2 ] ) layer1_3 = relu ( inputs_matrix_splits [ 3 ] * m_matrix_splits [ 3 ] ) layer1_4 = tanh ( inputs_matrix_splits [ 4 ] + m_matrix_splits [ 4 ] ) layer1_5 = sigmoid ( inputs_matrix_splits [ 5 ] + m_matrix_splits [ 5 ] ) layer1_6 = tanh ( inputs_matrix_splits [ 6 ] + m_matrix_splits [ 6 ] ) layer1_7 = sigmoid ( inputs_matrix_splits [ 7 ] + m_matrix_splits [ 7 ] ) # Second layer l2_0 = tanh ( layer1_0 * layer1_1 ) l2_1 = tanh ( layer1_2 + layer1_3 ) l2_2 = tanh ( layer1_4 * layer1_5 ) l2_3 = sigmoid ( layer1_6 + layer1_7 ) # Inject the cell l2_0 = tanh ( l2_0 + c_prev ) # Third layer l3_0_pre = l2_0 * l2_1 new_c = l3_0_pre # create new cell l3_0 = l3_0_pre l3_1 = tanh ( l2_2 + l2_3 ) # Final layer new_m = tanh ( l3_0 * l3_1 ) # Projection layer if specified if self . _num_proj is not None : concat_w_proj = vs . get_variable ( "projection_weights" , [ self . _num_units , self . _num_proj ] , dtype ) new_m = math_ops . matmul ( new_m , concat_w_proj ) new_state = rnn_cell_impl . LSTMStateTuple ( new_c , new_m ) return new_m , new_state