未验证 提交 820d0bc0 编写于 作者: S smellthemoon 提交者: GitHub

Fix range search error (#22352)

Signed-off-by: Nlixinguo <xinguo.li@zilliz.com>
Co-authored-by: Nlixinguo <xinguo.li@zilliz.com>
上级 a9a263d5
......@@ -46,7 +46,10 @@ SortRangeSearchResult(DatasetPtr data_set, int64_t topk, int64_t nq, std::string
// use p_id and p_dist to GenResultDataset after sorted
auto p_id = new int64_t[topk * nq];
memset(p_id, -1, sizeof(int64_t) * topk * nq);
auto p_dist = new float[topk * nq];
std::fill_n(p_dist, topk * nq, std::numeric_limits<float>::max());
// cnt means the subscript of p_id and p_dist
int cnt = 0;
......
......@@ -37,7 +37,9 @@ RangeSearchSortResultBF(milvus::DatasetPtr data_set, int64_t topk, size_t nq, st
auto id = milvus::GetDatasetIDs(data_set);
auto dist = milvus::GetDatasetDistance(data_set);
auto p_id = new int64_t[topk * nq];
memset(p_id, -1, sizeof(int64_t) * topk * nq);
auto p_dist = new float[topk * nq];
std::fill_n(p_dist, topk * nq, std::numeric_limits<float>::max());
// cnt means the subscript of p_id and p_dist
int cnt = 0;
for (int i = 0; i < nq; i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册