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.
      """
      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 math
  from typing import Optional, Tuple, Union
  import torch
  from torch import nn
  from torch.nn import CrossEntropyLoss
  from ...activations import ACT2FN
  from ...modeling_attn_mask_utils import _prepare_4d_attention_mask, _prepare_4d_causal_attention_mask
  from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPastAndCrossAttentions, Seq2SeqLMOutput, Seq2SeqModelOutput
  from ...modeling_utils import PreTrainedModel
  from ...utils import add_start_docstrings, add_start_docstrings_to_model_forward, logging, replace_return_docstrings
  from .configuration_speech_to_text import Speech2TextConfig
label_desc: Use image node_id 1 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