AscendIndexInt8IVFFlat

API Definition

AscendIndexInt8IVFFlat(int dims, int nlist, faiss::MetricType metric = MetricType::METRIC_L2, AscendIndexInt8IVFFlatConfig config = AscendIndexInt8IVFFlatConfig())

Function

Constructor of AscendIndexInt8IVFFlat. The NPU resources are set based on the value configured in config.

Input

int dims: dimensions of a group of feature vectors managed by AscendIndexInt8IVFFlat.

int nlist: number of cluster centroids, which corresponds to coarse_centroid_num in the operator generation script.

faiss::MetricType metric: distance measurement type used by AscendIndex when it retrieves feature vector similarity.

AscendIndexInt8IVFFlatConfig config: resource configuration on the NPU.

Output

N/A

Return Value

N/A

Restrictions

  • dim ∈ {64, 128, 256, 384, 512, 1024}
  • nlist ∈ {1024, 2048, 4096, 8192, 16384}
  • metric ∈ {faiss::MetricType::METRIC_L2, faiss::MetricType::METRIC_INNER_PRODUCT}