class_docstr: An RNN cell base class that can implement a stack or queue.
    
class_docstr_tok: ["An","RNN","cell","base","class","that","can","implement","a","stack","or","queue","."]
docstr: Make a call to the neural stack controller.
  
  See Section 3.1 of Grefenstette et al., 2015.
  
  Args:
    input_value: The input to the neural stack cell should be a tf.float32
      tensor with shape [batch_size, 1, embedding_size]
    read_values: The values of the read heads at the previous timestep.
    prev_state: The hidden state from the previous time step.
    batch_size: The size of the current batch of input values.
  
  Returns:
    A tuple of outputs and the new NeuralStackControllerInterface.
docstr_tok: ["Make","a","call","to","the","neural","stack","controller",".","See","Section","3.1","of","Grefenstette","et","al.",",","2015",".","Args",":","input_value",":","The","input","to","the","neural","stack","cell","should","be","a","tf.float32","tensor","with","shape","[","batch_size",",","1",",","embedding_size","]","read_values",":","The","values","of","the","read","heads","at","the","previous","timestep",".","prev_state",":","The","hidden","state","from","the","previous","time","step",".","batch_size",":","The","size","of","the","current","batch","of","input","values",".","Returns",":","A","tuple","of","outputs","and","the","new","NeuralStackControllerInterface","."]
code: def call_controller(
      self, input_value, read_values, prev_state, batch_size
  ):
      """Make a call to the neural stack controller.
  
      See Section 3.1 of Grefenstette et al., 2015.
  
      Args:
        input_value: The input to the neural stack cell should be a tf.float32
          tensor with shape [batch_size, 1, embedding_size]
        read_values: The values of the read heads at the previous timestep.
        prev_state: The hidden state from the previous time step.
        batch_size: The size of the current batch of input values.
  
      Returns:
        A tuple of outputs and the new NeuralStackControllerInterface.
      """
      with tf.name_scope("controller"):
          # Concatenate the current input value with the read values from the
          # previous timestep before feeding them into the controller.
          controller_inputs = tf.concat(
              [
                  contrib.layers().flatten(input_value),
                  contrib.layers().flatten(read_values),
              ],
              axis=1,
          )
  
          rnn_input = tf.tanh(
              tf.nn.bias_add(
                  tf.matmul(controller_inputs, self._input_proj),
                  self._input_bias,
              )
          )
  
          (rnn_output, state) = self.rnn(rnn_input, prev_state)
  
          push_strengths = tf.sigmoid(
              tf.nn.bias_add(
                  tf.matmul(rnn_output, self._push_proj),
                  self._push_bias,
              )
          )
  
          pop_strengths = tf.sigmoid(
              tf.nn.bias_add(
                  tf.matmul(rnn_output, self._pop_proj), self._pop_bias
              )
          )
  
          write_values = tf.tanh(
              tf.nn.bias_add(
                  tf.matmul(rnn_output, self._value_proj),
                  self._value_bias,
              )
          )
  
          outputs = tf.tanh(
              tf.nn.bias_add(
                  tf.matmul(rnn_output, self._output_proj),
                  self._output_bias,
              )
          )
  
          # Reshape all the outputs according to the shapes specified by
          # get_controller_shape()
          projected_outputs = [
              push_strengths,
              pop_strengths,
              write_values,
              outputs,
              state,
          ]
          next_state = [
              tf.reshape(output, shape=output_shape)
              for output, output_shape in zip(
                  projected_outputs,
                  self.get_controller_shape(batch_size),
              )
          ]
          return NeuralStackControllerInterface(*next_state)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  from tensor2tensor.layers import common_hparams
  from tensor2tensor.layers import common_layers
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
label_desc: Use image node_id 13 for calling the NeuralStackCell obj's underlying member method code with example usage: obj.call_controller(input_value, read_values, prev_state, batch_size) and returns: NeuralStackControllerInterface