Class: ForwardCache

Inherits:
Object
  • Object
show all
Defined in:
lib/toy/models/transformer.rb

Overview

Full forward cache used by backward.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeForwardCache

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

#layersObject

Returns the value of attribute layers.



397
398
399
# File 'lib/toy/models/transformer.rb', line 397

def layers
  @layers
end

#logitsObject

Returns the value of attribute logits.



397
398
399
# File 'lib/toy/models/transformer.rb', line 397

def logits
  @logits
end

#rms_finalObject

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_idsObject

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_outObject

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_embedObject

Returns the value of attribute x_embed.



397
398
399
# File 'lib/toy/models/transformer.rb', line 397

def x_embed
  @x_embed
end

#x_finalObject

Returns the value of attribute x_final.



397
398
399
# File 'lib/toy/models/transformer.rb', line 397

def x_final
  @x_final
end