Table of Contents

Method L2Normalize

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

L2Normalize(Span<float>)

Divides by the Euclidean norm, in place. A zero vector is left alone: the all-padding MeanPool(ReadOnlySpan<float>, ReadOnlySpan<long>, int, int, Span<float>) guard produces one, and dividing by a zero norm here would turn a defined zero vector into NaNs one call later.

public static void L2Normalize(Span<float> vector)

Parameters

vector Span<float>

The vector, normalised in place.