产品 |
是否支持 |
|---|---|
√ |
|
√ |
|
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); } |