Class: FFCache

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

Overview

Caches — per-sublayer activations needed by backward.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pre, hidden) ⇒ FFCache

Returns a new instance of FFCache.



355
356
357
358
# File 'lib/toy/models/transformer.rb', line 355

def initialize(pre, hidden)
  @pre = pre
  @hidden = hidden
end

Instance Attribute Details

#hiddenObject

Returns the value of attribute hidden.



354
355
356
# File 'lib/toy/models/transformer.rb', line 354

def hidden
  @hidden
end

#preObject

Returns the value of attribute pre.



354
355
356
# File 'lib/toy/models/transformer.rb', line 354

def pre
  @pre
end