code: def forward(self, q, k, position_ids, seq_len=None):
      # x: [bs, num_attention_heads, seq_len, head_size]
      if (
          seq_len > self.max_seq_len_cached
          or self.cos_cached is None
          or self.sin_cached is None
      ):
          if seq_len > self.max_seq_len_cached:
              self.max_seq_len_cached = seq_len
          self.cos_cached, self.sin_cached = self._create_cos_sin(
              self.true_inv_freq,
              self.max_seq_len_cached,
              q.dtype,
              q.device,
          )
      return rotary_forward(
          q, k, self.cos_cached, self.sin_cached, position_ids
      )
  
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 4 for calling the RotaryEmbedding obj's underlying member method code with example usage: obj.forward(q, k, position_ids, seq_len) and returns: rotary_forward