GetFeatures

API definition

APP_ERROR GetFeatures(int n, float *features, const idx_t *indices);

Function

Queries n feature vectors with specified indexes. The output data is stored on the host.

Input

int n: number of vectors to be obtained.

const idx_t *indices: index corresponding to a feature vector. The length is n.

Output

float *features: feature vector corresponding to an index. The length is n × dim (vector dimension).

Return value

APP_ERROR: return status. For details, see Return Code Reference.

Restrictions

  • indices: The index range of each feature is [0, ntotal). ntotal can be obtained through the GetNTotal API.
  • n: The value range is [0, capacity].
  • features and indices must be non-null pointers and their lengths must meet the requirements. Otherwise, an out-of-bounds read/write error may occur, causing program breakdown.

API definition

APP_ERROR GetFeatures(int n, float16_t *features, const idx_t *indices);

Function

Queries n feature vectors with specified indexes. The output data is stored on the host.

Input

int n: number of vectors to be obtained.

const idx_t *indices: index corresponding to a feature vector. The length is n.

Output

float16_t *features: feature vector corresponding to an index. The length is n × dim (vector dimension).

Return value

APP_ERROR: return status. For details, see Return Code Reference.

Restrictions

  • indices: The index range of each feature is [0, ntotal). ntotal can be obtained through the GetNTotal API.
  • n: The value range is [0, capacity].
  • features and indices must be non-null pointers and their lengths must meet the requirements. Otherwise, an out-of-bounds read/write error may occur, causing program breakdown.