Class: ForwardCache
- Inherits:
-
Object
- Object
- ForwardCache
- Defined in:
- lib/toy/models/transformer.rb
Overview
Full forward cache used by backward.
Instance Attribute Summary collapse
-
#layers ⇒ Object
Returns the value of attribute layers.
-
#logits ⇒ Object
Returns the value of attribute logits.
-
#rms_final ⇒ Object
Returns the value of attribute rms_final.
-
#token_ids ⇒ Object
Returns the value of attribute token_ids.
-
#x_block_out ⇒ Object
Returns the value of attribute x_block_out.
-
#x_embed ⇒ Object
Returns the value of attribute x_embed.
-
#x_final ⇒ Object
Returns the value of attribute x_final.
Instance Method Summary collapse
-
#initialize ⇒ ForwardCache
constructor
A new instance of ForwardCache.
Constructor Details
#initialize ⇒ ForwardCache
Returns a new instance of ForwardCache.
399 400 401 402 403 404 405 406 407 |
# File 'lib/toy/models/transformer.rb', line 399 def initialize @token_ids = nil @x_embed = nil @layers = nil @x_block_out = nil @x_final = nil @rms_final = nil @logits = nil end |
Instance Attribute Details
#layers ⇒ Object
Returns the value of attribute layers.
397 398 399 |
# File 'lib/toy/models/transformer.rb', line 397 def layers @layers end |
#logits ⇒ Object
Returns the value of attribute logits.
397 398 399 |
# File 'lib/toy/models/transformer.rb', line 397 def logits @logits end |
#rms_final ⇒ Object
Returns the value of attribute rms_final.
397 398 399 |
# File 'lib/toy/models/transformer.rb', line 397 def rms_final @rms_final end |
#token_ids ⇒ Object
Returns the value of attribute token_ids.
397 398 399 |
# File 'lib/toy/models/transformer.rb', line 397 def token_ids @token_ids end |
#x_block_out ⇒ Object
Returns the value of attribute x_block_out.
397 398 399 |
# File 'lib/toy/models/transformer.rb', line 397 def x_block_out @x_block_out end |
#x_embed ⇒ Object
Returns the value of attribute x_embed.
397 398 399 |
# File 'lib/toy/models/transformer.rb', line 397 def @x_embed end |
#x_final ⇒ Object
Returns the value of attribute x_final.
397 398 399 |
# File 'lib/toy/models/transformer.rb', line 397 def x_final @x_final end |