Class: Toy::LLM::Archs::LlamaArchForwardOut
- Inherits:
-
Object
- Object
- Toy::LLM::Archs::LlamaArchForwardOut
- Defined in:
- lib/toy/llm/archs/llama_arch.rb,
lib/toy/llm/archs/llama_arch_cuda.rb,
lib/toy/llm/archs/llama_arch_metal.rb
Overview
Carries the three per-graph OUTPUT handles back to the cache caller, which spreads them onto its OWN ivars so every existing downstream reader (@t_seq_logits accessor, build_training_step CE-loss consumer, examples/06 fcache.t_seq_logits) is untouched.
Hand-written plain class with a positional ctor — NEVER Struct.new (landmine #16 / matz/spinel#1043): a Struct’s synthesized accessors would unify across modules and mis-compile unrelated callers. The member names reuse the cache’s ‘t_seq_*` prefixes (type-isolated, no collision, same rationale as TransformerBlockCtx). Carries values, no behavior.
Instance Attribute Summary collapse
-
#t_seq_logits ⇒ Object
Returns the value of attribute t_seq_logits.
-
#t_seq_x_embed ⇒ Object
Returns the value of attribute t_seq_x_embed.
-
#t_seq_x_final ⇒ Object
Returns the value of attribute t_seq_x_final.
Instance Method Summary collapse
-
#initialize(t_seq_x_embed, t_seq_x_final, t_seq_logits) ⇒ LlamaArchForwardOut
constructor
A new instance of LlamaArchForwardOut.
Constructor Details
#initialize(t_seq_x_embed, t_seq_x_final, t_seq_logits) ⇒ LlamaArchForwardOut
Returns a new instance of LlamaArchForwardOut.
55 56 57 58 59 |
# File 'lib/toy/llm/archs/llama_arch.rb', line 55 def initialize(, t_seq_x_final, t_seq_logits) @t_seq_x_embed = @t_seq_x_final = t_seq_x_final @t_seq_logits = t_seq_logits end |
Instance Attribute Details
#t_seq_logits ⇒ Object
Returns the value of attribute t_seq_logits.
53 54 55 |
# File 'lib/toy/llm/archs/llama_arch.rb', line 53 def t_seq_logits @t_seq_logits end |
#t_seq_x_embed ⇒ Object
Returns the value of attribute t_seq_x_embed.
53 54 55 |
# File 'lib/toy/llm/archs/llama_arch.rb', line 53 def @t_seq_x_embed end |
#t_seq_x_final ⇒ Object
Returns the value of attribute t_seq_x_final.
53 54 55 |
# File 'lib/toy/llm/archs/llama_arch.rb', line 53 def t_seq_x_final @t_seq_x_final end |