docstr: Rotary positional embedding
  Reference : https://blog.eleuther.ai/rotary-embeddings/
  Paper: https://arxiv.org/pdf/2104.09864.pdf
  Args:
      dim: Dimension of embedding
      base: Base value for exponential
      precision: precision to use for numerical values
docstr_tok: ["Rotary","positional","embedding","Reference",":","https",":","\/\/blog.eleuther.ai\/rotary-embeddings\/","Paper",":","https",":","\/\/arxiv.org\/pdf\/2104.09864.pdf","Args",":","dim",":","Dimension","of","embedding","base",":","Base","value","for","exponential","precision",":","precision","to","use","for","numerical","values"]
code: def __init__(self, dim, base=10000, precision=torch.half):
      """Rotary positional embedding
      Reference : https://blog.eleuther.ai/rotary-embeddings/
      Paper: https://arxiv.org/pdf/2104.09864.pdf
      Args:
          dim: Dimension of embedding
          base: Base value for exponential
          precision: precision to use for numerical values
      """
      super().__init__()
      inv_freq = 1.0 / (base ** (torch.arange(0, dim, 2).float() / dim))
      self.register_buffer("inv_freq", inv_freq)
      self.seq_len_cached = 0
      self.cos_cached = torch.empty(self.seq_len_cached, 1, 1, dim)
      self.sin_cached = torch.empty(self.seq_len_cached, 1, 1, dim)
      self.precision = precision
  
imports: import torch
label_desc: Use image node_id 1 to create a new RotaryPositionalEmbedding object from inherited base classes: torch.nn with example: obj = RotaryPositionalEmbedding(dim, base, precision)