Embedding class
Constructors
- Embedding(int numEmbeddings, int embeddingDim, {Device device = Device.CPU, int seed = 0})
-
Constructs a table of shape
[numEmbeddings, embeddingDim]initialized with a small-scale normal (std = 1/sqrt(dim)) — this keeps output activations roughly unit-scaled before the first forward pass through the rest of the model.
Properties
- embeddingDim → int
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- numEmbeddings → int
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- training ↔ bool
-
Whether this module is in training mode. Layers that behave
differently between training and inference (e.g.
Dropout) read this flag in theircallmethod. Defaults to training mode.getter/setter pairinherited - weight → Tensor
-
final
Methods
-
call(
Tensor indices) → Tensor -
eval(
) → void -
Put this module (and any registered submodules) into evaluation mode.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parameters(
) → List< Tensor> -
Trainable tensors owned by this module (and its submodules).
override
-
submodules(
) → List< Module> -
Submodules owned by this module. Subclasses that compose other
modules should override this so
train()/eval()propagate. Default: empty.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
train(
) → void -
Put this module (and any registered submodules) into training mode.
inherited
-
zeroGrad(
) → void -
Zero every parameter's gradient. Safe to call before each
backward.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited