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: Lookup the offset to shift the write head at each step.
  
  By default, we move each write head forward by 1.
  
  This is exposed as its own function so that it can be overridden to provide
  alternate write adressing schemes.
  
  Args:
    write_head_index: Identifies which write head we're getting the index for.
  
  Returns:
    An integer offset to move the write head at each step.
docstr_tok: ["Lookup","the","offset","to","shift","the","write","head","at","each","step",".","By","default",",","we","move","each","write","head","forward","by","1",".","This","is","exposed","as","its","own","function","so","that","it","can","be","overridden","to","provide","alternate","write","adressing","schemes",".","Args",":","write_head_index",":","Identifies","which","write","head","we","'re","getting","the","index","for",".","Returns",":","An","integer","offset","to","move","the","write","head","at","each","step","."]
code: def get_write_head_offset(self, write_head_index):
      """Lookup the offset to shift the write head at each step.
  
      By default, we move each write head forward by 1.
  
      This is exposed as its own function so that it can be overridden to provide
      alternate write adressing schemes.
  
      Args:
        write_head_index: Identifies which write head we're getting the index for.
  
      Returns:
        An integer offset to move the write head at each step.
      """
      if write_head_index == 0:
          return 1
      else:
          raise ValueError("Write 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 7 for calling the NeuralStackCell obj's underlying member method code with example usage: obj.get_write_head_offset(write_head_index) and returns: int