BartDecoderLayer class

A single BART decoder layer.

Consists of:

  1. Self-attention with causal mask
  2. Cross-attention to encoder outputs
  3. Feed-forward network

Each sub-layer has a residual connection and layer normalization.

Constructors

BartDecoderLayer({required int embedDim, required int ffnDim, required int numHeads})

Properties

embedDim → int
final
encoderAttn ↔ BartAttention
getter/setter pair
encoderAttnLayerNorm ↔ LayerNorm
getter/setter pair
fc1 ↔ Linear
getter/setter pair
fc2 ↔ Linear
getter/setter pair
ffnDim → int
final
finalLayerNorm ↔ LayerNorm
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
numHeads → int
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selfAttn ↔ BartAttention
getter/setter pair
selfAttnLayerNorm ↔ LayerNorm
getter/setter pair

Methods

forward(Tensor hiddenStates, {required Tensor encoderHiddenStates, (Tensor, Tensor)? selfAttnPast, (Tensor, Tensor)? crossAttnPast, Tensor? causalMask}) → (Tensor, (Tensor, Tensor), (Tensor, Tensor))
Forward pass.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited