Table of Contents

Method ClsPool

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

ClsPool(ReadOnlySpan<float>, int, int, Span<float>)

Copies row zero, the [CLS] position. bge-small-en-v1.5 pools this way.

public static void ClsPool(ReadOnlySpan<float> lastHiddenState, int sequenceLength, int dimensions, Span<float> destination)

Parameters

lastHiddenState ReadOnlySpan<float>

One row of the output tensor, [sequenceLength, dimensions], row-major.

sequenceLength int

The padded width.

dimensions int

The embedding width.

destination Span<float>

Where the pooled vector is written. At least dimensions long.