class_docstr: This module produces sinusoidal positional embeddings of any length.
  
  Padding symbols are ignored.
class_docstr_tok: ["This","module","produces","sinusoidal","positional","embeddings","of","any","length",".","Padding","symbols","are","ignored","."]
docstr: Input is expected to be of size [bsz x seqlen].
code: def forward(
      self,
      input,
      step=0,
      incremental_state=None,
      timestep=None,
      positions=None,
  ):
      """Input is expected to be of size [bsz x seqlen]."""
      bsz, seq_len = input.size(0), input.size(1)
      positions = self.make_positions(input, self.padding_idx, step)
      mask = (
          torch.ne(input, self.padding_idx)
          .unsqueeze(2)
          .expand(bsz, seq_len, self.embedding_dim)
      )
      return (
          self.weights.to(input.device)
          .index_select(0, positions.view(-1))
          .view(bsz, seq_len, -1)
          * mask
      ).detach()
  
imports: import __init__
  import math
  import uuid
  from typing import Dict, Optional, List
  import torch
  from torch import Tensor, nn
  from torch.nn import Parameter, LayerNorm, Dropout
  from csrc.pytorch import util
  from csrc.pytorch.layer_base import TransformerEmbeddingLayerBase, TransformerEncoderLayerBase, TransformerDecoderLayerBase
  from csrc.pytorch.quantization import QuantLinear, TensorQuantizer, act_quant_config, weight_quant_config, out_quant_config, emb_quant_config
label_desc: Use image node_id 4 for calling the SinusoidalPositionalEmbedding obj's underlying member method code with example usage: obj.forward(input, step, incremental_state, timestep, positions) and returns: unknown