Class: HeadCache

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(q, k, v, attn, head_out) ⇒ HeadCache

Returns a new instance of HeadCache.



363
364
365
366
367
368
369
# File 'lib/toy/models/transformer.rb', line 363

def initialize(q, k, v, attn, head_out)
  @q = q
  @k = k
  @v = v
  @attn = attn
  @head_out = head_out
end

Instance Attribute Details

#attnObject

Returns the value of attribute attn.



362
363
364
# File 'lib/toy/models/transformer.rb', line 362

def attn
  @attn
end

#head_outObject

Returns the value of attribute head_out.



362
363
364
# File 'lib/toy/models/transformer.rb', line 362

def head_out
  @head_out
end

#kObject

Returns the value of attribute k.



362
363
364
# File 'lib/toy/models/transformer.rb', line 362

def k
  @k
end

#qObject

Returns the value of attribute q.



362
363
364
# File 'lib/toy/models/transformer.rb', line 362

def q
  @q
end

#vObject

Returns the value of attribute v.



362
363
364
# File 'lib/toy/models/transformer.rb', line 362

def v
  @v
end