AscendIndexFlat

API definition

AscendIndexFlat(const faiss::IndexFlat *index, AscendIndexFlatConfig config = AscendIndexFlatConfig());

Function

Constructor of AscendIndexFlat, which is used to create a retrieval index on the Ascend based on an existing index.

Input

const faiss::IndexFlat *index: index resources on the CPU.

AscendIndexFlatConfig 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 dimension d of this index is {32, 64, 128, 256, 384, 512, 768, 1024, 1408, 1536, 2048, 3072, 3584, 4096}. The value range of the total number of vectors is 0 ≤ n < 1e9. The value of metric_type can be faiss::MetricType::METRIC_L2 or faiss::MetricType::METRIC_INNER_PRODUCT.

API definition

AscendIndexFlat(const faiss::IndexIDMap*index, AscendIndexFlatConfig config = AscendIndexFlatConfig());

Function

Constructor of AscendIndexFlat, 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.

AscendIndexFlatConfig config: resource configuration on the device.

Output

N/A

Return value

N/A

Restrictions

index must be a valid IndexIDMap pointer. The value range of the dimension d of this index is {32, 64, 128, 256, 384, 512, 768, 1024, 1408, 1536, 2048, 3072, 3584, 4096}. The value range of the total number of vectors is 0 ≤ n < 1e9. The value of metric_type can be faiss::MetricType::METRIC_L2 or faiss::MetricType::METRIC_INNER_PRODUCT.

API definition

AscendIndexFlat(int dims, faiss::MetricType metric, AscendIndexFlatConfig config = AscendIndexFlatConfig());

Function

Constructor of AscendIndexFlat, which is used to generate an AscendIndexFlat whose dimension is dims. The device 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 AscendIndex.

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

AscendIndexFlatConfig config: resource configuration on the device.

Output

N/A

Return value

N/A

Restrictions

  • dims ∈ {32, 64, 128, 256, 384, 512, 768, 1024, 1408, 1536, 2048, 3072, 3584, 4096}.
  • metric ∈ {faiss::MetricType::METRIC_L2, faiss::MetricType::METRIC_INNER_PRODUCT}.

API definition

AscendIndexFlat(const AscendIndexFlat&) = delete;

Function

Declares that the copy constructor of this Index class is void, that is, it cannot be copied.

Input

const AscendIndexFlat&: constant AscendIndexFlat

Output

N/A

Return value

N/A

Restrictions

N/A

API definition

virtual ~AscendIndexFlat();

Function

Destructor of AscendIndexFlat, which is used to destroy the AscendIndexFlat object and resources.

Input

N/A

Output

N/A

Return value

N/A

Restrictions

N/A