昇腾社区首页
中文
注册

AscendIndexInt8IVF

API定义

AscendIndexInt8IVF(int dims, faiss::MetricType metric, int nlist, AscendIndexInt8IVFConfig config = AscendIndexInt8IVFConfig())

功能描述

AscendIndexInt8IVF的构造函数,根据“config”中配置的值设置NPU侧资源。

输入

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

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

int nlist:聚类中心的个数。

AscendIndexInt8IVFConfig config:NPU侧资源配置。

输出

返回值

约束说明

  • “dims”为不小于64,不大于1024的整数,且需要能被64整除。
  • nlist ∈ {1024, 2048, 4096, 8192, 16384}