Table of Contents

Property Pooling

Namespace
Qavren.Edge.Embeddings.Onnx
Assembly
Qavren.Edge.Embeddings.Onnx.dll

Pooling

How the batch pools. From the preset, NEVER a default: bge-small is CLS and everything else here is mean, and getting it wrong is a silent retrieval regression with no exception anywhere.

public required EmbeddingPooling Pooling { get; init; }

Property Value

EmbeddingPooling

Remarks

Read ONLY when the graph's declared output is rank-3 [batch, sequence, dim], which is what last_hidden_state is and what all four shipped presets emit. A graph whose output is rank-2 [batch, dim] has pooled in its own head - a sentence_embedding / pooler_output export - and there is no sequence axis left to pool over, so the row is taken verbatim and this property is not applied. Layer-norm and L2 still run on both paths. Spec 11 describes the last_hidden_state path only; the rank-2 path is an extension this implementation carries so a consumer's own in-graph-pooled model yields a correct vector instead of an ArgumentOutOfRangeException from a stride computed for three ranks, and spec 11 needs the sentence.