未验证 提交 fbce4b9f 编写于 作者: S shaoyue 提交者: GitHub

[skip ci] Add comment for calc_distance.go (#13079)

Signed-off-by: Nshaoyue.chen <shaoyue.chen@zilliz.com>
上级 0ba6f3fc
......@@ -85,6 +85,7 @@ func CalcIP(dim int64, left []float32, lIndex int64, right []float32, rIndex int
return sum
}
// CalcFFBatch calculate the distance of @left & @right vectors in batch by given @metic, store result in @result
func CalcFFBatch(dim int64, left []float32, lIndex int64, right []float32, metric string, result *[]float32) {
rightNum := int64(len(right)) / dim
for i := int64(0); i < rightNum; i++ {
......@@ -98,6 +99,8 @@ func CalcFFBatch(dim int64, left []float32, lIndex int64, right []float32, metri
}
}
// CalcFloatDistance calculate float distance by given metric
// it will checks input, and calculate the distance concurrently
func CalcFloatDistance(dim int64, left, right []float32, metric string) ([]float32, error) {
if dim <= 0 {
err := errors.New("invalid dimension")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册