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: Creates a mask which allows us to attenuate subsequent read strengths.
  
  This is exposed as its own function so that it can be overridden to provide
  alternate read adressing schemes.
  
  Args:
    read_head_index: Identifies which read head we're getting the mask for.
  
  Returns:
    A tf.float32 tensor of shape [1, 1, memory_size, memory_size]
docstr_tok: ["Creates","a","mask","which","allows","us","to","attenuate","subsequent","read","strengths",".","This","is","exposed","as","its","own","function","so","that","it","can","be","overridden","to","provide","alternate","read","adressing","schemes",".","Args",":","read_head_index",":","Identifies","which","read","head","we","'re","getting","the","mask","for",".","Returns",":","A","tf.float32","tensor","of","shape","[","1",",","1",",","memory_size",",","memory_size","]"]
code: def get_read_mask(self, read_head_index):
      """Creates a mask which allows us to attenuate subsequent read strengths.
  
      This is exposed as its own function so that it can be overridden to provide
      alternate read adressing schemes.
  
      Args:
        read_head_index: Identifies which read head we're getting the mask for.
  
      Returns:
        A tf.float32 tensor of shape [1, 1, memory_size, memory_size]
      """
      if read_head_index == 0:
          return tf.expand_dims(
              common_layers.mask_pos_lt(
                  self._memory_size, self._memory_size
              ),
              axis=0,
          )
      else:
          raise ValueError("Read head index must be 0 for stack.")
  
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 6 for calling the NeuralStackCell obj's underlying member method code with example usage: obj.get_read_mask(read_head_index) and returns: tf