[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, aclnnFastLayerNorm improves the overall performance by 50%, and the memory usage is the same as that of the GPU. The accumulation order is optimized, resulting in different precision.

  • 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 . You must call the aclnnFastLayerNormGetWorkspaceSize API to obtain the workspace size required for computation and the executor that contains the operator computation process, and then call the aclnnFastLayerNorm API to perform the computation.

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

    [object Object]
  • Return Value

    [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]
  • Return Value

    [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:
    • The default deterministic implementation of aclnnFastLayerNorm is used.
[object Object]

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

[object Object]