GetAccVal
功能说明
获取ReduceSum(针对tensor前n个数据计算)接口的计算结果。
函数原型
| 1 2 | template <typename T> __aicore__ inline T GetAccVal() | 
参数说明
| 参数名 | 描述 | 
|---|---|
| T | ReduceSum指令的数据类型,支持half/float。 | 
返回值
ReduceSum(针对tensor前n个数据计算)接口的计算结果。
支持的型号
Atlas A2训练系列产品/Atlas 800I A2推理产品
约束说明
无。
调用示例
| 1 2 3 4 5 | AscendC::LocalTensor<float> src; AscendC::LocalTensor<float> work; AscendC::LocalTensor<float> dst; AscendC::ReduceSum(dst, src, work, 128); float res = AscendC::GetAccVal<float>(); | 
父主题: 矢量计算