下载
中文
注册

AscendIndexFlat

API定义

AscendIndexFlat(int dims, faiss::MetricType metric, AscendIndexFlatConfig config = AscendIndexFlatConfig());

功能描述

AscendIndexFlat的构造函数,生成维度为dims的AscendIndexFlat(单个Index管理的一组向量的维度是唯一的),此时根据“config”中配置的值设置Device侧资源。

输入

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

faiss::MetricType metric:AscendIndexFlat在执行特征向量相似度检索的时候使用的距离度量类型。

AscendIndexFlatConfig config:Device侧资源配置。

输出

返回值

约束说明

  • dims ∈ {32, 64, 128, 256, 384, 512, 768, 1024, 2048, 3072, 4096}。
  • metric ∈ {faiss::MetricType::METRIC_L2,faiss::MetricType::METRIC_INNER_PRODUCT}。