EmbeddingForwardPass class abstract
One engine's forward-pass implementation.
An instance is built and lives inside a single isolate — see ForwardPassDescriptor for how the ability to build one crosses an isolate boundary. Once built, the SAME isolate that called load must be the one that calls run and close: the concrete implementation owns native (FFI) handles that cannot themselves cross isolates.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- inputSequenceLength → int?
-
Sequence length the model was compiled/loaded for, if the engine knows
it ahead of a forward pass (e.g. LiteRT auto-detects it from the
compiled model's input tensor layout).
nullwhen the engine has no fixed input length to report (e.g. a dynamic-shape ONNX graph) — the worker's_Readyhandshake falls back to-1in that case.no setter - outputContract → EmbeddingOutputContract?
-
Overrides ForwardPassDescriptor.outputContract once the engine knows
its actual output layout — only knowable for ONNX after the session
opens (output names live in the graph), but the descriptor is built
before that (design D-T2). The worker resolves the effective contract
as
pass.outputContract ?? descriptor.outputContract.no setter - outputDimension → int
-
Output embedding dimension. Valid only after load completes.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → Future< void> - Free native resources. Must be safe to call multiple times.
-
load(
) → Future< void> - Load/compile the model. Heavy (hundreds of ms for a real native engine) — call once, then reuse for many run calls.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
run(
{required List< int> tokenIds, List<int> ? attentionMask, List<int> ? tokenTypeIds}) → Future<ForwardResult> - Run one forward pass over already-tokenized input.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited