copyFrom

API definition

void copyFrom(faiss::IndexFlat *index);

Function

Copies AscendIndexFlat to the Ascend based on an existing index, clears the current AscendIndexFlatL2 database, and retains the resource configuration on the device of the original AscendIndex.

Input

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

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 {64, 128, 256, 384, 512, 1024, 1408, 1536, 2048, 3584}. The value range of the total number of vectors is 0 ≤ n < 1e9. The value of metric_type is faiss::MetricType::METRIC_L2.