reduce

API definition

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

Function

API for dimension reduction. No specific implementation is provided.

Input

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

  • Range of n: 0 < n < 1e9.
  • x and res must be non-null pointers, and their lengths must be dimIn × n and dimOut × n, respectively. Otherwise, an out-of-bounds read/write error may occur, causing program breakdown.