code: def shift_tokens_right(
      input_ids: torch.Tensor,
      pad_token_id: int,
      decoder_start_token_id: int,
  ):
      """
      Shift input ids one token to the right.
  
      Args:
          input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`): input ids
          pad_token_id (`int`): The id of the `padding` token.
          decoder_start_token_id (`int`): The id of the `start` token.
      """
      shifted_input_ids = input_ids.new_zeros(input_ids.shape)
      shifted_input_ids[:, 1:] = input_ids[:, :-1].clone()
      shifted_input_ids[:, 0] = decoder_start_token_id
  
      if pad_token_id is None:
          raise ValueError(
              "self.model.config.pad_token_id has to be defined."
          )
      # replace possible -100 values in labels by `pad_token_id`
      shifted_input_ids.masked_fill_(
          shifted_input_ids == -100, pad_token_id
      )
  
      return shifted_input_ids
  
imports: import copy
  import inspect
  import warnings
  from typing import Optional, Tuple
  import accelerate
  import torch
  from accelerate.hooks import add_hook_to_module, remove_hook_from_module
  from accelerate.utils import is_npu_available, is_xpu_available
  from safetensors.torch import storage_ptr, storage_size
  from ..import_utils import is_auto_gptq_available, is_torch_tpu_available
  from .constants import CONFIG_NAME, EMBEDDING_LAYER_NAMES, INCLUDE_LINEAR_LAYERS_SHORTHAND, SAFETENSORS_WEIGHTS_NAME, TRANSFORMERS_MODELS_TO_ADALORA_TARGET_MODULES_MAPPING, TRANSFORMERS_MODELS_TO_IA3_FEEDFORWARD_MODULES_MAPPING, TRANSFORMERS_MODELS_TO_IA3_TARGET_MODULES_MAPPING, TRANSFORMERS_MODELS_TO_LORA_TARGET_MODULES_MAPPING, TRANSFORMERS_MODELS_TO_PREFIX_TUNING_POSTPROCESS_MAPPING, WEIGHTS_NAME, bloom_model_postprocess_past_key_value, starcoder_model_postprocess_past_key_value
label_desc: Use image node_id 4 for calling a global function with example usage: shift_tokens_right(input_ids, pad_token_id, decoder_start_token_id) and returns: shifted_input_ids