docstr: Shift input ids one token to the right, and pad with start_token_id
docstr_tok: ["Shift","input","ids","one","token","to","the","right",",","and","pad","with","start_token_id"]
code: def shift_tokens_right(self, input_ids, start_token_id=None):
      """Shift input ids one token to the right, and pad with start_token_id"""
  
      if start_token_id is None:
          start_token_id = self.generator.config.decoder_start_token_id
          assert start_token_id is not None, (
              "self.generator.config.decoder_start_token_id has to be defined. In Rag we commonly use Bart as"
              " generator, see Bart docs for more information"
          )
  
      pad_token_id = self.generator.config.pad_token_id
      assert (
          pad_token_id is not None
      ), "self.model.config.pad_token_id has to be defined."
  
      start_tokens = tf.fill(
          (shape_list(input_ids)[0], 1),
          tf.cast(start_token_id, input_ids.dtype),
      )
      shifted_input_ids = tf.concat(
          [start_tokens, input_ids[:, :-1]], -1
      )
  
      # replace possible -100 values in labels by `pad_token_id`
      shifted_input_ids = tf.where(
          shifted_input_ids == -100,
          tf.fill(
              shape_list(shifted_input_ids),
              tf.cast(pad_token_id, input_ids.dtype),
          ),
          shifted_input_ids,
      )
  
      # "Verify that `labels` has only positive values and -100"
      assert_gte0 = tf.debugging.assert_greater_equal(
          shifted_input_ids, tf.cast(0, shifted_input_ids.dtype)
      )
  
      # Make sure the assertion op is called by wrapping the result in an identity no-op
      with tf.control_dependencies([assert_gte0]):
          shifted_input_ids = tf.identity(shifted_input_ids)
  
      return shifted_input_ids
  
imports: from __future__ import annotations
  import copy
  from dataclasses import dataclass
  from typing import List, Optional, Tuple, Union
  import numpy
  import tensorflow
  from ...configuration_utils import PretrainedConfig
  from ...generation import TFLogitsProcessorList
  from ...modeling_tf_utils import TFCausalLanguageModelingLoss, TFModelInputType, TFPreTrainedModel, shape_list, unpack_inputs
  from ...utils import ModelOutput, add_start_docstrings_to_model_forward, logging, replace_return_docstrings
  from .configuration_rag import RagConfig
  from .retrieval_rag import RagRetriever
label_desc: Use image node_id 13 for calling the TFRagTokenForGeneration obj's underlying member method code with example usage: obj.shift_tokens_right(input_ids, start_token_id) and returns: shifted_input_ids