Skip to content

Commit 01c1992

Browse files
authored
Merge pull request ydb-platform#6 from MBkkt/BitIndex
Fix typo
2 parents 75e82f8 + 456ce3e commit 01c1992

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

ydb/library/yql/udfs/common/knn/knn-distance.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,15 @@ inline TDistanceResult KnnCosineSimilarity(const TStringRef& str1, const TString
185185
switch (format1) {
186186
case EFormat::FloatVector:
187187
return VectorFunc<float>(str1, str2, [&](const float* v1, const float* v2, size_t len) {
188-
auto res = ::TriWayDotProduct(v1, v2, len);
188+
const auto res = ::TriWayDotProduct(v1, v2, len);
189189
return compute(res.LL, res.LR, res.RR);
190190
});
191191
case EFormat::Uint8Vector:
192192
return VectorFunc<ui8>(str1, str2, [&](const ui8* v1, const ui8* v2, size_t len) {
193193
// TODO We can optimize it if we will iterate over both vector at the same time, look to the float implementation
194-
const auto ll = ::DotProduct(v1, v2, len);
195-
const auto lr = ::DotProduct(v1, v2, len);
196-
const auto rr = ::DotProduct(v1, v2, len);
194+
const ui64 ll = ::DotProduct(v1, v1, len);
195+
const ui64 lr = ::DotProduct(v1, v2, len);
196+
const ui64 rr = ::DotProduct(v2, v2, len);
197197
return compute(ll, lr, rr);
198198
});
199199
case EFormat::BitVector:

ydb/library/yql/udfs/common/knn/test/canondata/test.test_CosineDistance_/results.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"Data" = [
8686
[
8787
[
88-
"0"
88+
"1"
8989
]
9090
]
9191
]
@@ -147,7 +147,7 @@
147147
"Data" = [
148148
[
149149
[
150-
"0"
150+
"0.025368094"
151151
]
152152
]
153153
]

ydb/library/yql/udfs/common/knn/test/canondata/test.test_CosineSimilarity_/results.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"Data" = [
8686
[
8787
[
88-
"1"
88+
"0"
8989
]
9090
]
9191
]
@@ -147,7 +147,7 @@
147147
"Data" = [
148148
[
149149
[
150-
"1"
150+
"0.9746319"
151151
]
152152
]
153153
]

ydb/library/yql/udfs/common/knn/test/canondata/test.test_Uint8Serialization_/results.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
"Data" = [
120120
[
121121
[
122-
"0"
122+
"0.025368094"
123123
]
124124
]
125125
]
@@ -150,7 +150,7 @@
150150
"Data" = [
151151
[
152152
[
153-
"0"
153+
"0.025368094"
154154
]
155155
]
156156
]
@@ -181,7 +181,7 @@
181181
"Data" = [
182182
[
183183
[
184-
"0"
184+
"0.025368094"
185185
]
186186
]
187187
]
@@ -212,7 +212,7 @@
212212
"Data" = [
213213
[
214214
[
215-
"0"
215+
"0.025368094"
216216
]
217217
]
218218
]

0 commit comments

Comments
 (0)