[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:res_for_gamma=(inputmean)×rstdres\_for\_gamma = (input - mean) \times rstd dy_g=gradOut×weightOptionaldy\_g = gradOut \times weightOptional temp1=1/N×reduce_axis_1gradOut×weightOptionaltemp_1 = 1/N \times \sum_{reduce\_axis\_1} gradOut \times weightOptional temp2=1/N×(inputmean)×rstd×reduce_axis_1(gradOut×weightOptional×(inputmean)×rstd)temp_2 = 1/N \times (input - mean) \times rstd \times \sum_{reduce\_axis\_1}(gradOut \times weightOptional \times (input - mean) \times rstd) gradInputOut=(gradOut×weightOptional(temp1+temp2))×rstdgradInputOut = (gradOut \times weightOptional - (temp_1 + temp_2)) \times rstd gradWeightOut=reduce_axis_0gradOut×(inputmean)×rstdgradWeightOut = \sum_{reduce\_axis\_0}gradOut \times (input - mean) \times rstd gradBiasOut=reduce_axis_0gradOutgradBiasOut = \sum_{reduce\_axis\_0}gradOut N indicates the dimension of the axis on which normalization computation is performed, that is, the size of the normalized axis dimension.
[object Object]

Each operator has calls. First, aclnnLayerNormBackwardGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnLayerNormBackward is called to perform computation.

[object Object]
[object Object]
[object Object]
  • Parameters

    [object Object]
    • [object Object]Atlas inference products[object Object] and [object Object]Atlas training products[object Object]:

      The data type of gradOut, input, mean, rstd, weightOptional, biasOptional, gradInputOut, gradWeightOut, and gradBiasOut does not support BFLOAT16.

  • Returns

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

    The first-phase API implements input parameter validation. The following error codes may be returned.

    [object Object]
[object Object]
  • Parameters

    [object Object]
  • Returns

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

[object Object]
  • Shape constraints:

    The shape of gradOut, input, mean, rstd, weightOptional (non-empty), biasOptional (non-empty), gradInputOut (non-empty), gradWeightOut (non-empty), or gradBiasOut (non-empty) supports one to eight dimensions.

  • Deterministic computation:

    aclnnLayerNormBackward defaults to a deterministic implementation.

[object Object]

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

[object Object]