Description:
Computes the gradient of the BatchNorm operation during backpropagation and performs reduction operations on some intermediate results to optimize the compute efficiency. The calculation result is as follows:
- Computes the gradient of the loss function l with respect to the scaling weight γ.
- Computes the gradient of the loss function l with respect to the offset β.
- Deduces the intermediate quantities sumDy and sumDyXmu required for computing , by using the deviation d[object Object]yi[object Object] of the loss function l with respect to the output y[object Object]i[object Object], where is the gradient of the loss function l with respect to the input x[object Object]i[object Object] of the corresponding layer.
Formula:
Each operator has calls. First, aclnnBatchNormReduceBackwardGetWorkspaceSize is called to obtain the input parameters and compute the required workspace size based on the process. Then, aclnnBatchNormReduceBackward is called to perform computation.
[object Object]
[object Object]
Parameters
[object Object]- [object Object]Atlas training products[object Object] and [object Object]Atlas inference products[object Object]: The data types of
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object], and[object Object]cannot be BFLOAT16.
- [object Object]Atlas training products[object Object] and [object Object]Atlas inference products[object Object]: The data types of
Returns:
[object Object]: status code. For details, see .The first-phase API implements input parameter verification. The following errors may be thrown.
[object Object]
- If any input is an empty tensor, the output is an empty tensor.
- Deterministic compute:
- aclnnBatchNormReduceBackward defaults to a deterministic implementation.
The following example is for reference only. For details, see .
[object Object]