Description: Fuses LayerNorm with downstream Add and Mul, and adjusts the normalization process through the adaptive parameters scale and shift. Compared with the AdaLayerNorm operator, this operator has two additional output parameters (the mean value of the input and the reciprocal of the standard deviation of the input), and provides additional restrictions on data types supported by weight and bias.
Formula:
LayerNorm calculation formula:
E(x) indicates the input's mean value, and Var(x) indicates the input's variance.
Each operator has calls. First, aclnnAdaLayerNormV2GetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnAdaLayerNormV2 is called to perform computation.
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]
- Deterministic compute:
- aclnnAdaLayerNormV2 defaults to a deterministic implementation.
The following example is for reference only. For details, see .