reduce

API Definition

virtual void reduce(Index::idx_t n, const float *x, float *res) const = 0

Function

API for dimension reduction. No specific implementation is provided.

Input

Index::idx_t n: number of inputs for inference.

const float *x: feature vector to be inferred.

Output

float* res: feature vector result obtained after inference.

Return Value

N/A

Restrictions

  • The value of n cannot be greater than 1e9.
  • The x and res must be non-null pointers, and their lengths must be dimIn x n and dimOut x n, respectively. Otherwise, an out-of-bounds read/write error may occur, causing program breakdown.