diff --git a/eng/tools/ToolDescriptionEvaluator/src/VectorDb/VectorDB.cs b/eng/tools/ToolDescriptionEvaluator/src/VectorDb/VectorDB.cs index 18d4a01d5f..b1bbfd923d 100644 --- a/eng/tools/ToolDescriptionEvaluator/src/VectorDb/VectorDB.cs +++ b/eng/tools/ToolDescriptionEvaluator/src/VectorDb/VectorDB.cs @@ -39,13 +39,7 @@ public float Distance(float[] a, float[] b) if (a.Length != b.Length) throw new ArgumentException("Vector lengths must match"); - float dotProduct = 0.0f; - for (int i = 0; i < a.Length; i++) - { - dotProduct += a[i] * b[i]; - } - - return dotProduct; + return TensorPrimitives.Dot(a.AsSpan(), b.AsSpan()); } }