AscendIndexIVF
API Definition |
AscendIndexIVF(int dims, faiss::MetricType metric, int nlist, AscendIndexIVFConfig config = AscendIndexIVFConfig()) |
|---|---|
Function |
Constructor of AscendIndexIVF, which is used to generate AscendIndexIVF. The NPU resources are set based on the value configured in config. |
Input |
int dims: dimensions of a group of feature vectors managed by AscendIndexInt8IVF. faiss::MetricType metric: distance measurement type used by AscendIndex when it retrieves feature vector similarity. Currently, faiss::MetricType::METRIC_L2 and faiss::MetricType::METRIC_INNER_PRODUCT are supported. int nlist: number of cluster centroids, which corresponds to coarse_centroid_num in the operator generation script. AscendIndexIVFConfig config: resource configuration on the NPU. |
Output |
N/A |
Return Value |
N/A |
Restrictions |
nlist ∈ {1024, 2048, 4096, 8192, 16384} |