SetBias

Applicability

Product

Supported

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

x

Atlas inference product's AI Core

x

Atlas inference product's Vector Core

x

Atlas training products

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);
}