[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Performs normalization with a mean of 0 and a standard deviation of 1 on a specified layer. Compared with aclnnLayerNorm, aclnnLayerNormWithImplMode allows you to select different normalization policies by configuring the impl_mode parameter to adapt to different application scenarios and performance requirements.

  • Formula:

    out=xE[x]Var[x]+epsweightOptional+biasOptionalout = \frac{x - \mathrm{E}[x]}{ \sqrt{\mathrm{Var}[x] + eps}} * weightOptional + biasOptional meanOutOptional=E[x]meanOutOptional = \mathrm{E}[x] rstdOutOptional=1Var[x]+epsrstdOutOptional = \frac{1}{ \sqrt{\mathrm{Var}[x] + eps}}

    E[x] indicates the input's mean value, and Var[x] indicates the input's variance.

[object Object]

Each operator has calls. First, aclnnLayerNormGetWorkspaceSize or aclnnLayerNormWithImplModeGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnLayerNorm or aclnnLayerNormWithImplMode is called to perform computation.

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

    [object Object]
    • [object Object]Atlas training products[object Object] and [object Object]Atlas 200I/500 A2 inference products[object Object]: The data type of input, weightOptional, biasOptional, out, meanOutOptional, and rstdOutOptional 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]
  • Parameters

    [object Object]
    • [object Object]Atlas training products[object Object] and [object Object]Atlas 200I/500 A2 inference products[object Object]: The data type of input, weightOptional, biasOptional, out, meanOutOptional, and rstdOutOptional 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]
  • The shape of input, normalizedShape, weightOptional (non-empty), biasOptional (non-empty), out, meanOutOptional (non-empty), or rstdOutOptional (non-empty) cannot exceed eight dimensions.
  • Deterministic computation:
    • aclnnLayerNorm defaults to a deterministic implementation.
    • aclnnLayerNormWithImplMode defaults to a deterministic implementation.
[object Object]

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

  • Example for aclnnLayerNorm:

    [object Object]
  • Example for aclnnLayerNormWithImplMode:

    [object Object]