class_docstr: This module produces sinusoidal positional embeddings of any length.
class_docstr_tok: ["This","module","produces","sinusoidal","positional","embeddings","of","any","length","."]
docstr: Replace non-padding symbols with their position numbers. Position numbers begin at padding_idx+1. Padding
  symbols are ignored. This is modified from fairseq's `utils.make_positions`.
  
  Args:
      x: torch.Tensor x:
  Returns: torch.Tensor
docstr_tok: ["Replace","non-padding","symbols","with","their","position","numbers",".","Position","numbers","begin","at","padding_idx+1",".","Padding","symbols","are","ignored",".","This","is","modified","from","fairseq","'s","`","utils.make_positions","`",".","Args",":","x",":","torch.Tensor","x",":","Returns",":","torch.Tensor"]
code: def create_position_ids_from_input_ids(
      self,
      input_ids: torch.Tensor,
      padding_idx: int,
      past_key_values_length: Optional[int] = 0,
  ):
      """
      Replace non-padding symbols with their position numbers. Position numbers begin at padding_idx+1. Padding
      symbols are ignored. This is modified from fairseq's `utils.make_positions`.
  
      Args:
          x: torch.Tensor x:
      Returns: torch.Tensor
      """
      # The series of casts and type-conversions here are carefully balanced to both work with ONNX export and XLA.
      mask = input_ids.ne(padding_idx).int()
      incremental_indices = (
          torch.cumsum(mask, dim=1).type_as(mask)
          + past_key_values_length
      ) * mask
      return incremental_indices.long() + padding_idx
  
imports: import copy
  import math
  import random
  from typing import Optional, Tuple
  import torch
  from torch import nn
  from torch.nn import CrossEntropyLoss
  from ...activations import ACT2FN
  from ...modeling_outputs import BaseModelOutputWithPastAndCrossAttentions, CausalLMOutputWithCrossAttentions
  from ...modeling_utils import PreTrainedModel
  from ...utils import add_start_docstrings, logging, replace_return_docstrings
  from .configuration_speech_to_text_2 import Speech2Text2Config
label_desc: Use image node_id 5 for calling the Speech2Text2SinusoidalPositionalEmbedding obj's underlying member method code with example usage: obj.create_position_ids_from_input_ids(input_ids, padding_idx, past_key_values_length) and returns: unknown