ForwardResult class

Raw forward-pass output: a flat, row-major buffer plus its tensor shape.

shape is one of two layouts a forward pass can hand back — see pooling.dart's meanPoolAndNormalize for how each is turned into a single embedding vector:

  • [1, dim] — already pooled by the engine (e.g. a LiteRT compiled model whose graph itself produces one vector per input). Treated as a pass-through.
  • [1, seq, dim] — per-token hidden states. Mean-pooled over the seq axis (optionally respecting an attention mask) before normalizing.

Constructors

ForwardResult({required List<double> values, required List<int> shape, List<int>? attentionMask})
const

Properties

attentionMask List<int>?
The effective attention mask over this result's seq axis, when the pass knows one (design D-T3's silent-regression fix). A pass that pads a fixed-shape graph MUST pad tokenIds/mask/tokenTypeIds together and echo the padded mask here, so the worker's masked mean-pool excludes exactly the padding it added — never the caller-supplied run(attentionMask:), which describes the UNPADDED input. A pass over a dynamic-shape graph (no padding) may pass the input mask through unchanged or omit it — the worker falls back to the request's mask.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shape List<int>
Tensor shape, e.g. [1, dim] or [1, seq, dim].
final
values List<double>
Flat, row-major buffer. values.length == shape.reduce((a, b) => a * b).
final

Methods

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