class_docstr: An subclass of the NeuralStackCell which reads/writes in both directions.
  
  See section 3.3 of Grefenstette et al., 2015.
class_docstr_tok: ["An","subclass","of","the","NeuralStackCell","which","reads\/writes","in","both","directions",".","See","section","3.3","of","Grefenstette","et","al.",",","2015","."]
code: def get_write_head_offset(self, write_head_index):
      if write_head_index == 0:
          # Move the bottom write position back at each timestep.
          return -1
      elif write_head_index == 1:
          # Move the top write position forward at each timestep.
          return 1
      else:
          raise ValueError("Write head index must be 0 or 1 for deque.")
  
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 3 for calling the NeuralDequeCell obj's underlying member method code with example usage: obj.get_write_head_offset(write_head_index) and returns: unknown, int