AscendIndexFlatL2

API definition

AscendIndexFlatL2(faiss::IndexFlatL2 *index, AscendIndexFlatConfig config = AscendIndexFlatConfig());

Function

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

Input

faiss::IndexFlatL2 *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 dimension d of this index is {32, 64, 128, 256, 384, 512, 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 is faiss::MetricType::METRIC_L2.

API definition

AscendIndexFlatL2(int dims, AscendIndexFlatConfig config = AscendIndexFlatConfig());

Function

Constructor of AscendIndexFlatL2, which is used to generate an AscendIndexFlatL2 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 AscendIndexFlatL2.

AscendIndexFlatConfig config: resource configuration on the device.

Output

N/A

Return value

N/A

Restrictions

dims ∈ {32, 64, 128, 256, 384, 512, 1024, 1408, 1536, 2048, 3072, 4096, 3584}

API definition

AscendIndexFlatL2(const AscendIndexFlatL2&) = delete;

Function

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

Input

const AscendIndexFlatL2&: constant AscendIndexFlatL2

Output

N/A

Return value

N/A

Restrictions

N/A

API definition

virtual ~AscendIndexFlatL2()

Function

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

Input

N/A

Output

N/A

Return value

N/A

Restrictions

N/A