AscendIndexSQ
API definition |
AscendIndexSQ(const faiss::IndexScalarQuantizer* index, AscendIndexSQConfig config = AscendIndexSQConfig()); |
|---|---|
Function |
Constructor of AscendIndexSQ, which is used to create a retrieval index on the Ascend based on an existing index. |
Input |
const faiss::IndexScalarQuantizer* index: index resources on the CPU. AscendIndexSQConfig config: resource configuration on the device. |
Output |
N/A |
Return value |
N/A |
Restrictions |
index must be a valid CPU Index pointer. The value range of d of this index is {64, 128, 256, 384, 512, 768}. The value range of the total number of vectors is 0 ≤ n < 1e9. The value of metric_type is faiss::MetricType::METRIC_L2 or faiss::MetricType::METRIC_INNER_PRODUCT. And sq.qtype supports only ScalarQuantizer::QuantizerType::QT_8bit. |
API definition |
AscendIndexSQ(const faiss::IndexIDMap* index, AscendIndexSQConfig config = AscendIndexSQConfig()); |
|---|---|
Function |
Constructor of AscendIndexSQ, which is used to create a retrieval index on the Ascend based on an existing index. |
Input |
const faiss::IndexIDMap* index: index resources on the CPU. AscendIndexSQConfig config: resource configuration on the device. |
Output |
N/A |
Return value |
N/A |
Restrictions |
index must be a valid CPU Index pointer. The value range of the member index dimension d of this index is {64, 128, 256, 384, 512, 768}. The value range of the total number of vectors is 0 ≤ n < 1e9. The value of metric_type is faiss::MetricType::METRIC_L2 or faiss::MetricType::METRIC_INNER_PRODUCT. And sq.qtype supports only ScalarQuantizer::QuantizerType::QT_8bit. |
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 dims. The device resources are configured based on the value set 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::ScalarQuantizer::QuantizerType qType = ScalarQuantizer::QuantizerType::QT_8bit: Currently, only ScalarQuantizer::QuantizerType::QT_8bit is supported. faiss::MetricType metric: distance measurement type used by AscendIndex when it retrieves feature vector similarity. AscendIndexSQConfig config: resource configuration on the device. |
Output |
N/A |
Return value |
N/A |
Restrictions |
|
API definition |
AscendIndexSQ(const AscendIndexSQ&) = delete; |
|---|---|
Function |
Declares that the copy constructor of this Index class is void, that is, it cannot be copied. |
Input |
const AscendIndexSQ&: AscendIndexSQ object. |
Output |
N/A |
Return value |
N/A |
Restrictions |
N/A |
API definition |
virtual ~AscendIndexSQ(); |
|---|---|
Function |
Destructor of AscendIndexSQ, which is used to destroy the AscendIndexSQ object and resources. |
Input |
N/A |
Output |
N/A |
Return value |
N/A |
Restrictions |
N/A |