AscendIndexIVFSQ
API definition |
AscendIndexIVFSQ(const faiss::IndexIVFScalarQuantizer *index, AscendIndexIVFSQConfig config = AscendIndexIVFSQConfig()); |
|---|---|
Function |
Constructor of AscendIndexIVFSQ, which is used to create a retrieval index on the Ascend based on an existing index. |
Input |
const faiss::IndexIVFScalarQuantizer *index: resource configuration on the CPU. AscendIndexIVFSQConfig config: resource configuration on the device. |
Output |
N/A |
Return value |
N/A |
Restrictions |
index must be a valid CPU Index pointer. |
API definition |
AscendIndexIVFSQ(int dims, int nlist, faiss::ScalarQuantizer::QuantizerType qtype = ScalarQuantizer::QuantizerType::QT_8bit, faiss::MetricType metric = MetricType::METRIC_L2, bool encodeResidual = true, AscendIndexIVFSQConfig config = AscendIndexIVFSQConfig()); |
|---|---|
Function |
Constructor of AscendIndexIVFSQ, which generates AscendIndexIVFSQ. The device resources are set based on the value configured in config. |
Input |
int dims: dimensions of a group of feature vectors managed by AscendIndexIVFSQ. int nlist: number of cluster centroids, which corresponds to coarse_centroid_num in the operator generation script. faiss::ScalarQuantizer::QuantizerType qtype: quantizer type of AscendIndexIVFSQ. faiss::MetricType metric: distance measurement type used by AscendIndex when it retrieves feature vector similarity. bool encodeResidual: whether to encode residuals. AscendIndexIVFSQConfig config: resource configuration on the device. |
Output |
N/A |
Return value |
N/A |
Restrictions |
|
API definition |
AscendIndexIVFSQ(int dims, int nlist, faiss::MetricType metric, AscendIndexIVFSQConfig config); |
|---|---|
Function |
Constructor of AscendIndexIVFSQ, which generates AscendIndexIVFSQ. The device resources are set based on the value configured in config. This API does not perform initialization, which, instead, is performed by its subclass. This API will be deprecated later, and avoid using it. |
Input |
int dims: dimensions of a group of feature vectors managed by AscendIndexIVFSQ. 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. AscendIndexIVFSQConfig config: resource configuration on the device. |
Output |
N/A |
Return value |
N/A |
Restrictions |
|
API definition |
AscendIndexIVFSQ(const AscendIndexIVFSQ&) = delete; |
|---|---|
Function |
Declares that the copy constructor of this Index class is void, that is, it cannot be copied. |
Input |
const AscendIndexIVFSQ&: constant AscendIndexIVFSQ |
Output |
N/A |
Return value |
N/A |
Restrictions |
N/A |