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: Create a new NeuralStackCell.
  
  Args:
    num_units: The number of hidden units in the RNN cell.
    memory_size: The maximum memory size allocated for the stack.
    embedding_size:  The embedding width of the individual stack values.
    num_read_heads: This should always be 1 for a regular stack.
    num_write_heads: This should always be 1 for a regular stack.
    reuse: Whether to reuse the weights.
docstr_tok: ["Create","a","new","NeuralStackCell",".","Args",":","num_units",":","The","number","of","hidden","units","in","the","RNN","cell",".","memory_size",":","The","maximum","memory","size","allocated","for","the","stack",".","embedding_size",":","The","embedding","width","of","the","individual","stack","values",".","num_read_heads",":","This","should","always","be","1","for","a","regular","stack",".","num_write_heads",":","This","should","always","be","1","for","a","regular","stack",".","reuse",":","Whether","to","reuse","the","weights","."]
code: def __init__(
      self,
      num_units,
      memory_size,
      embedding_size,
      num_read_heads=1,
      num_write_heads=1,
      reuse=None,
  ):
      """Create a new NeuralStackCell.
  
      Args:
        num_units: The number of hidden units in the RNN cell.
        memory_size: The maximum memory size allocated for the stack.
        embedding_size:  The embedding width of the individual stack values.
        num_read_heads: This should always be 1 for a regular stack.
        num_write_heads: This should always be 1 for a regular stack.
        reuse: Whether to reuse the weights.
      """
      super(NeuralStackCell, self).__init__(
          dtype=tf.float32, _reuse=reuse
      )
      self._num_units = num_units
      self._embedding_size = embedding_size
      self._memory_size = memory_size
      self._num_read_heads = num_read_heads
      self._num_write_heads = num_write_heads
  
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 1 to create a new NeuralStackCell object from inherited base classes: tf.nn.rnn_cell with example: obj = NeuralStackCell(num_units, memory_size, embedding_size, num_read_heads, num_write_heads, reuse)