- Description: Implements the AddLayerNorm function.
- Formula: Where, E(x) indicates the mean value and Var(x) indicates the variance. Both the mean value and variance must be calculated within the operator.
Each operator has calls. First, [object Object] is called to obtain the input parameters and compute the required workspace size based on the process. Then, [object Object] is called to perform computation.
Parameters
[object Object]- [object Object]Atlas inference products[object Object]:
- The data types of the
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object], and[object Object]parameters cannot be BFLOAT16. - The
[object Object]and[object Object]parameters are invalid in the current product.
- The data types of the
- [object Object]Atlas inference products[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]
Function dimension
- The supported data types are as follows:
- [object Object]Atlas inference products[object Object]: x1, x2, beta, gamma, and biasOptional support FLOAT32 and FLOAT16.
- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]: x1, x2, beta, gamma, and biasOptional support FLOAT32, FLOAT16, and BFLOAT16.
- rstdOut and meanOut support FLOAT32.
- The data format can be ND.
- [object Object]Atlas inference products[object Object]: The length of the last axis of the inputs x1, x2, beta, gamma, and biasOptional must be greater than or equal to 32 bytes.
- The supported data types are as follows:
Description of unsupported types
- DOUBLE: DOUBLE is not supported.
Description of boundary value scenarios
- When the input is Inf, the output is Inf.
- When the input is NaN, the output is NaN.
Description of data types supported by different products
[object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]:
[object Object]undefined
[object Object]Atlas inference products[object Object]:
[object Object]undefined
Deterministic compute:
- aclnnAddLayerNorm defaults to a deterministic implementation.
The following example is for reference only. For details, see .