SetBias
产品支持情况
产品 |
是否支持 |
---|---|
√ |
|
√ |
|
x |
|
x |
|
x |
|
x |
|
x |
功能说明
设置偏置矩阵Bias。
函数原型
1 | __aicore__ inline void SetBias(const AscendC::GlobalTensor<BiasT>& bias) |
参数说明
参数名 |
输入/输出 |
描述 |
---|---|---|
bias |
输入 |
Bias在Global Memory上的地址。类型为GlobalTensor。偏置矩阵Bias支持的数据类型为:half/bfloat16_t。 |
返回值说明
无
约束说明
在卷积计算中,如果涉及偏置矩阵Bias,必须调用此接口;若卷积计算不涉及Bias,则不应调用此接口。
调用示例
1 2 3 4 5 | GlobalTensor<float> biasGm; biasGm.SetGlobalBuffer(reinterpret_cast<__gm__ half *>(bias)); if (biasFlag) { conv3dApi.SetBias(biasGm); } |
父主题: Conv3D