code: def _pointer_feedback(pointers, encoder_output, shift=True):
      """Feedback loop for pointer networks.
  
      Args:
        pointers: [batch_size, target_length] int tensor with pointers into the
          source sentence.
        encoder_output: [batch_size, input_length, hidden_size] tensor with encoder
          outputs.
        shift: Whether to shift the pointers to the right.
  
      Returns:
        A [batch_size, target_length, hidden_size] tensor with encoder outputs.
      """
      if shift:
          pointers = common_layers.shift_right_2d(pointers)
      return gather_2d(encoder_output, pointers)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import logging
  from tensor2tensor.layers import common_attention
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import transformer_layers
  from tensor2tensor.models import transformer
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
label_desc: Use image node_id 6 for calling a global function with example usage: _pointer_feedback(pointers, encoder_output, shift) and returns: gather_2d