Class: Toy::LLM::Primitives::RoPE::Cfg
- Inherits:
-
Object
- Object
- Toy::LLM::Primitives::RoPE::Cfg
- Defined in:
- lib/toy/llm/primitives/rope.rb,
lib/toy/llm/primitives/rope_cuda.rb,
lib/toy/llm/primitives/rope_metal.rb
Overview
Cfg value object — concrete scalar fields, Spinel-safe. All five scaling values are copied as plain Floats at realize time (decoupling the primitive from the RopeScaling object). freq_factors is intentionally NOT a field here: it is a per-realize FFI ptr passed explicitly to apply_2d.
Instance Attribute Summary collapse
-
#attn_factor ⇒ Object
Returns the value of attribute attn_factor.
-
#base ⇒ Object
Returns the value of attribute base.
-
#beta_fast ⇒ Object
Returns the value of attribute beta_fast.
-
#beta_slow ⇒ Object
Returns the value of attribute beta_slow.
-
#d_head ⇒ Object
Returns the value of attribute d_head.
-
#ext_factor ⇒ Object
Returns the value of attribute ext_factor.
-
#freq_scale ⇒ Object
Returns the value of attribute freq_scale.
Instance Method Summary collapse
-
#initialize(d_head, base, freq_scale, ext_factor, attn_factor, beta_fast, beta_slow) ⇒ Cfg
constructor
A new instance of Cfg.
Constructor Details
#initialize(d_head, base, freq_scale, ext_factor, attn_factor, beta_fast, beta_slow) ⇒ Cfg
Returns a new instance of Cfg.
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/toy/llm/primitives/rope.rb', line 36 def initialize(d_head, base, freq_scale, ext_factor, attn_factor, beta_fast, beta_slow) @d_head = d_head @base = base @freq_scale = freq_scale @ext_factor = ext_factor @attn_factor = attn_factor @beta_fast = beta_fast @beta_slow = beta_slow end |
Instance Attribute Details
#attn_factor ⇒ Object
Returns the value of attribute attn_factor.
32 33 34 |
# File 'lib/toy/llm/primitives/rope.rb', line 32 def attn_factor @attn_factor end |
#base ⇒ Object
Returns the value of attribute base.
32 33 34 |
# File 'lib/toy/llm/primitives/rope.rb', line 32 def base @base end |
#beta_fast ⇒ Object
Returns the value of attribute beta_fast.
32 33 34 |
# File 'lib/toy/llm/primitives/rope.rb', line 32 def beta_fast @beta_fast end |
#beta_slow ⇒ Object
Returns the value of attribute beta_slow.
32 33 34 |
# File 'lib/toy/llm/primitives/rope.rb', line 32 def beta_slow @beta_slow end |
#d_head ⇒ Object
Returns the value of attribute d_head.
32 33 34 |
# File 'lib/toy/llm/primitives/rope.rb', line 32 def d_head @d_head end |
#ext_factor ⇒ Object
Returns the value of attribute ext_factor.
32 33 34 |
# File 'lib/toy/llm/primitives/rope.rb', line 32 def ext_factor @ext_factor end |
#freq_scale ⇒ Object
Returns the value of attribute freq_scale.
32 33 34 |
# File 'lib/toy/llm/primitives/rope.rb', line 32 def freq_scale @freq_scale end |