[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Fuses LayerNorm with downstream Add and Mul, and adjusts the normalization process through the adaptive parameters scale and shift.

  • Formula:

    out=LayerNorm(x)(1+scale)+shiftout = LayerNorm(x) * (1 + scale) + shift

    LayerNorm calculation formula:

    LayerNorm(x)=xE(x)Var(x)+epsilonweightOptional+biasOptionalLayerNorm(x) = {{x-E(x)}\over\sqrt {Var(x)+epsilon}} * weightOptional + biasOptional

    E(x) indicates the input's mean value, and Var(x) indicates the input's variance.

[object Object]

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

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

    [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:
    • aclnnAdaLayerNorm defaults to a deterministic implementation.
[object Object]

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

[object Object]