AscendIndexIVF

API定义

AscendIndexIVF(int dims, faiss::MetricType metric, int nlist, AscendIndexIVFConfig config = AscendIndexIVFConfig());

功能描述

AscendIndexIVF的构造函数,生成AscendIndexIVF,此时根据“config”中配置的值设置Device侧资源。

输入

int dims:AscendIndexIVF管理的一组特征向量的维度。

faiss::MetricType metric:AscendIndex在执行特征向量相似度检索的时候使用的距离度量类型,当前支持“faiss::MetricType::METRIC_L2”以及“faiss::MetricType::METRIC_INNER_PRODUCT”

int nlist:聚类中心的个数,与算子生成脚本中的“coarse_centroid_num”参数对应。

AscendIndexIVFConfig config:Device侧资源配置。

输出

返回值

约束说明

nlist ∈ {1024, 2048, 4096, 8192, 16384, 32768}