docstr: Shift input ids one token to the right.
docstr_tok: ["Shift","input","ids","one","token","to","the","right","."]
code: def shift_tokens_right(
      self, input_ids: torch.Tensor, pad_token_id: int
  ):
      """
      Shift input ids one token to the right.
      """
      shifted_input_ids = input_ids.new_zeros(
          (input_ids.shape[0], input_ids.shape[1] - 1)
      )
      shifted_input_ids = input_ids[:, :-1].clone()
  
      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 inspect
  import warnings
  from typing import Optional, Tuple, Dict, Any
  import os
  import torch
  import torch.nn
  import torch.nn.functional
  from transformers.utils import ModelOutput
  from transformers.modeling_utils import PreTrainedModel
  from transformers.configuration_utils import PretrainedConfig
  from torch.nn import CrossEntropyLoss
  from .abstract_model import AbstractModel
label_desc: Use image node_id 8 for calling the RNNSeq2Seq obj's underlying member method code with example usage: obj.shift_tokens_right(input_ids, pad_token_id) and returns: shifted_input_ids