code: def __init__(
      self, dim, max_position_embeddings, base=10000, device=None
  ):
      super().__init__()
      self.true_inv_freq = 1.0 / (
          base ** (torch.arange(0, dim, 2).float().to(device) / dim)
      )
      self.register_buffer("inv_freq", self.true_inv_freq)
  
      # Build here to make `torch.jit.trace` work.
      self.max_seq_len_cached = max_position_embeddings
      self.cos_cached = None
      self.sin_cached = None
  
imports: from typing import Optional, Tuple, Union
  import os
  import torch
  import torch.distributed
  import torch.utils.checkpoint
  from torch import nn
  from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
  from transformers.activations import ACT2FN
  from transformers.file_utils import add_code_sample_docstrings, add_start_docstrings, add_start_docstrings_to_model_forward, replace_return_docstrings
  from transformers.modeling_outputs import BaseModelOutputWithPast, CausalLMOutputWithPast, QuestionAnsweringModelOutput, SequenceClassifierOutputWithPast, TokenClassifierOutput
  from transformers.modeling_utils import PreTrainedModel
  from transformers import GPTNeoXConfig
  from loguru import logger
  from text_generation_server.utils.layers import TensorParallelColumnLinear, TensorParallelEmbedding, TensorParallelRowLinear, TensorParallelHead
label_desc: Use image node_id 1 to create a new RotaryEmbedding object from inherited base classes: torch.nn with example: obj = RotaryEmbedding(dim, max_position_embeddings, base, device)