class_docstr: PersimmonRotaryEmbedding extended with linear scaling. Credits to the Reddit user /u/kaiokendev
class_docstr_tok: ["PersimmonRotaryEmbedding","extended","with","linear","scaling",".","Credits","to","the","Reddit","user","\/u\/kaiokendev"]
code: def __init__(
      self,
      dim,
      max_position_embeddings=2048,
      base=10000,
      device=None,
      scaling_factor=1.0,
  ):
      self.scaling_factor = scaling_factor
      super().__init__(dim, max_position_embeddings, base, device)
  
imports: import math
  from typing import List, Optional, Tuple, Union
  import torch
  import torch.utils.checkpoint
  from torch import nn
  from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
  from ...activations import ACT2FN
  from ...cache_utils import Cache, DynamicCache
  from ...modeling_attn_mask_utils import _prepare_4d_causal_attention_mask
  from ...modeling_outputs import BaseModelOutputWithPast, CausalLMOutputWithPast, SequenceClassifierOutputWithPast
  from ...modeling_utils import PreTrainedModel
  from ...utils import add_start_docstrings, add_start_docstrings_to_model_forward, logging, replace_return_docstrings
  from .configuration_persimmon import PersimmonConfig
label_desc: Use image node_id 1 to create a new PersimmonLinearScalingRotaryEmbedding object from inherited base classes: PersimmonRotaryEmbedding with example: obj = PersimmonLinearScalingRotaryEmbedding(dim, max_position_embeddings, base, device, scaling_factor)