reduce

API定义

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

功能描述

降维接口,本函数中不提供具体实现。

输入

idx_t n:输入的待执行推理的输入数量。

const float *x:待执行推理的特征向量。

输出

float* res:执行推理得到的特征向量结果。

返回值

约束说明

  • 此处“n”的取值范围:0 < n < 1e9。
  • 此处指针“x”需要为非空指针,且长度应该为dimIn * n“res”需要为非空指针,且长度应该为dimOut * n,否则可能出现越界读写的错误并引起程序崩溃。