SetBias
Applicability
Product |
Supported |
|---|---|
√ |
|
√ |
|
x |
|
x |
|
x |
|
x |
Function
Sets the bias matrix Bias.
Prototype
1 | __aicore__ inline void SetBias(const AscendC::GlobalTensor<BiasT>& bias) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
bias |
Input |
Address of Bias in the Global Memory. The type is GlobalTensor. The supported data types of the bias matrix Bias are half and bfloat16_t. |
Returns
None
Restrictions
In convolution computation, if the bias matrix Bias is involved, this API must be called. If Bias is not involved, this API should not be called.
Example
1 2 3 4 5 | GlobalTensor<float> biasGm; biasGm.SetGlobalBuffer(reinterpret_cast<__gm__ half *>(bias)); if (biasFlag) { conv3dApi.SetBias(biasGm); } |
Parent topic: Conv3D Kernel APIs