AscendIndexSQ

API Definition

AscendIndexSQ(int dims, faiss::ScalarQuantizer::QuantizerType qType = ScalarQuantizer::QuantizerType::QT_8bit, faiss::MetricType metric = MetricType::METRIC_L2, AscendIndexSQConfig config = AscendIndexSQConfig())

Function

Constructor of AscendIndexSQ, which is used to generate an AscendIndex whose dimension is dim. The NPU resources are configured based on the value configured in config. Note that the dimension of a group of vectors managed by a single index is unique.

Input

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

faiss qtype = ScalarQuantizer::QuantizerType::QT_8bit: supports only ScalarQuantizer::QuantizerType::QT_8bit.

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

AscendIndexSQConfig config: resource configuration on the NPU.

Output

N/A

Return Value

N/A

Restrictions

  • dim ∈ {64, 128, 256, 384, 512}.
  • metric ∈ {faiss::MetricType::METRIC_L2, faiss::MetricType::METRIC_INNER_PRODUCT}.