GetFeatures

API definition

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

Function

Queries n feature vectors with specified indexes.

Input

int n: number of feature vectors

const idx_t *indices: index of the index to be queried. The length is n.

Output

float16_t *features: feature vector corresponding to an index. The length is n × dim (vector dimension). Before calling this API, you need to allocate the memory to ensure that the memory size is correct.

Return value

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

Restrictions

  • The input parameters must meet the requirements of the implementation class of this class.
  • 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.