class_docstr: Facebook implementation of rotary embeddings.
class_docstr_tok: ["Facebook","implementation","of","rotary","embeddings","."]
code: def precompute_freqs_cis(dim: int, end: int, theta: float = 10000.0):
      freqs = 1.0 / (
          theta ** (torch.arange(0, dim, 2)[: (dim // 2)].float() / dim)
      )
      t = torch.arange(end, device=freqs.device)  # type: ignore
      freqs = torch.outer(t, freqs).float()  # type: ignore
      freqs_cis = torch.polar(
          torch.ones_like(freqs), freqs
      )  # complex64
      return freqs_cis
  
imports: import torch
  import math
  from typing import Tuple
  from einops import repeat
label_desc: Use image node_id 5 for calling the RotaryLLAMA obj's underlying member method code with example usage: obj.precompute_freqs_cis(dim, end, theta) and returns: freqs_cis