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","."]
code: def __init__(
      self, embedding_dim, padding_idx, init_size=1024, fp16=False
  ):
      super().__init__()
      self.embedding_dim = embedding_dim
      self.padding_idx = padding_idx
      self.weights = SinusoidalPositionalEmbedding.get_embedding(
          init_size, embedding_dim, padding_idx
      )
      if fp16:
          self.weights = self.weights.to(torch.half)
  
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 1 to create a new SinusoidalPositionalEmbedding object from inherited base classes: nn with example: obj = SinusoidalPositionalEmbedding(embedding_dim, padding_idx, init_size, fp16)