Embedding class

Lookup table embedding layer.

Maps integer token IDs to dense vectors.

Constructors

Embedding(int numEmbeddings, int embeddingDim, {int? paddingIdx})

Properties

embeddingDim int
final
hashCode int
The hash code for this object.
no setterinherited
numEmbeddings int
final
paddingIdx int?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
weight Tensor
Embedding weight matrix (numEmbeddings, embeddingDim).
getter/setter pair

Methods

forward(List<int> indices) Tensor
Forward pass: lookup embeddings for given token IDs.
forwardBatch(Tensor indices) Tensor
Batch forward: indices is shape (batch, seqLen), returns (batch, seqLen, embeddingDim).
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