GetFeatureByLabel

API definition

APP_ERROR GetFeatureByLabel(int64_t count, const int64_t *labels, void *features);

Function

Obtains the feature of a specified label.

Input

int64_t count: number of features to be obtained.

const int64_t *labels: feature label.

Output

void *features: feature obtained based on the specified label. The Hamming distance requires data of the uint8_t type, Int8Flat requires data of the int8_t type, FP16Flat requires data of the float type.

Return value

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

Restrictions

  • Value range of count: [1, 1e6]
  • The length of labels must be count, and each element must be unique and exist in the database. Otherwise, an out-of-bounds read/write error may occur, causing program breakdown.
  • The length of features must be count × dim (vector dimension). Otherwise, an out-of-bounds read/write error may occur, causing program breakdown.