copyFrom

API definition

void copyFrom(const faiss::IndexBinaryFlat *index);

Function

Copies an existing index to AscendIndexBinaryFlat, clears the current AscendIndexBinaryFlat database, and retains the original resource configuration on the device.

Input

const faiss::IndexBinaryFlat *index: faiss::IndexBinaryFlat pointer.

Output

N/A

Return value

N/A

Restrictions

index must be a valid IndexBinaryFlat pointer. index->d ∈ {256, 512, 1024}. index->ntotal is the smaller value between the actual memory capacity of the chip and 1e9.

API definition

void copyFrom(const faiss::IndexBinaryIDMap *index);

Function

Copies an existing index to AscendIndexBinaryFlat, clears the current AscendIndexBinaryFlat database, and retains the original resource configuration on the device.

Input

const faiss::IndexBinaryIDMap *index: faiss::IndexIDMap pointer.

Output

N/A

Return value

N/A

Restrictions

index must be a valid faiss::IndexBinaryIDMap pointer. index->index must be a valid IndexBinaryFlat pointer. index->index->d ∈ {256, 512, 1024}. index->index->ntotal is the smaller value between the actual memory capacity of the chip and 1e9.