Class: LayerCache

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLayerCache

Returns a new instance of LayerCache.



383
384
385
386
387
388
389
390
391
392
# File 'lib/toy/models/transformer.rb', line 383

def initialize
  @rms1 = nil
  @h_norm1 = nil
  @attn_cache = nil
  @x_attn = nil
  @rms2 = nil
  @h_norm2 = nil
  @ff_cache = nil
  @x_out = nil
end

Instance Attribute Details

#attn_cacheObject

Returns the value of attribute attn_cache.



381
382
383
# File 'lib/toy/models/transformer.rb', line 381

def attn_cache
  @attn_cache
end

#ff_cacheObject

Returns the value of attribute ff_cache.



381
382
383
# File 'lib/toy/models/transformer.rb', line 381

def ff_cache
  @ff_cache
end

#h_norm1Object

Returns the value of attribute h_norm1.



381
382
383
# File 'lib/toy/models/transformer.rb', line 381

def h_norm1
  @h_norm1
end

#h_norm2Object

Returns the value of attribute h_norm2.



381
382
383
# File 'lib/toy/models/transformer.rb', line 381

def h_norm2
  @h_norm2
end

#rms1Object

Returns the value of attribute rms1.



381
382
383
# File 'lib/toy/models/transformer.rb', line 381

def rms1
  @rms1
end

#rms2Object

Returns the value of attribute rms2.



381
382
383
# File 'lib/toy/models/transformer.rb', line 381

def rms2
  @rms2
end

#x_attnObject

Returns the value of attribute x_attn.



381
382
383
# File 'lib/toy/models/transformer.rb', line 381

def x_attn
  @x_attn
end

#x_outObject

Returns the value of attribute x_out.



381
382
383
# File 'lib/toy/models/transformer.rb', line 381

def x_out
  @x_out
end