[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Performs backpropagation of . It is used to compute the gradient of the input tensor, so that the model parameters can be updated during backpropagation.

  • Formula:

    • When training is true:

      gradInput=weightnsaveVar+eps(ngradOuti=0mgradOutxsaveMeansaveVar+epsi=0m(gradOutxsaveMeansaveVar+eps))gradInput = \frac{weight}{ n{\sqrt{saveVar + eps}} }(n * gradOut - \sum^m_{i=0}{gradOut} - \frac{x-saveMean}{ {\sqrt{saveVar + eps}} }\sum^m_{i=0}({gradOut} *\frac{x-saveMean}{ {\sqrt{saveVar + eps}} } )) gradWeight=i=0m[gradOut(xsaveMean)]1saveVar+epsgradWeight = \sum^m_{i=0}[{gradOut} * (x - saveMean)] * \frac{1}{ {\sqrt{saveVar + eps}} } gradBias=i=0mgradOutgradBias = \sum^m_{i=0}{gradOut}
    • When training is false:

      gradInput=gradOut1runningVar+epsweightgradInput = gradOut * \frac{1}{ {\sqrt{runningVar + eps}} } * weight gradWeight=i=0m[gradOut(xrunningMean)]1runningVar+epsgradWeight = \sum^m_{i=0}[{gradOut} * (x - runningMean)] * \frac{1}{ {\sqrt{runningVar + eps}} } gradBias=i=0mgradOutgradBias = \sum^m_{i=0}{gradOut}
[object Object]

Each operator has calls. First, aclnnBatchNormBackwardGetWorkspaceSize is called to obtain the input parameters and compute the required workspace size based on the process. Then, aclnnBatchNormBackward is called to perform computation.

[object Object]
[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 the [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], and [object Object] parameters cannot be BFLOAT16.
      • The data types of the [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], and [object Object] parameters are the same as that of [object Object].
      • The data formats of the [object Object], [object Object], and [object Object] parameters cannot be NHWC and NDHWC.
    • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]:

      • The data types of the [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], and [object Object] parameters are the same as that of [object Object].
      • The data formats of the [object Object], [object Object], and [object Object] parameters cannot be NHWC and NDHWC.
    • Ascend 950PR/Ascend 950DT:

      • When [object Object] is set to FLOAT32, [object Object], [object Object], [object Object], [object Object], [object Object] must be set to FLOAT32.
      • When [object Object] is set to FLOAT16, [object Object], [object Object], [object Object], [object Object], [object Object] must be set to FLOAT16 or FLOAT32.
      • When [object Object] is BFLOAT16, [object Object], [object Object], [object Object], [object Object], [object Object] must be BFLOAT16 or FLOAT32.
      • If [object Object] is FLOAT32, [object Object] must be FLOAT32. If [object Object] is FLOAT16, [object Object] must be FLOAT16 or FLOAT32. If [object Object] is BFLOAT16, [object Object] must be BFLOAT16 or FLOAT32.
      • The data type of [object Object] must be the same as that of [object Object].
      • The data type of [object Object] must be the same as that of [object Object].
  • Returns:

    [object Object]: status code. For details, see .

    The first-phase API implements input parameter verification. The following errors may be thrown.

    [object Object]
[object Object]
  • Parameters

    [object Object]
  • Returns:

    [object Object]: status code. For details, see .

[object Object]
  • Deterministic compute:
    • aclnnBatchNormBackward defaults to a non-deterministic implementation. You can call aclrtCtxSetSysParamOpt to enable deterministic compute.
[object Object]

The following example is for reference only. For details, see .

[object Object]