[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Computes the group normalization result groupnormOut, mean value meanOut, and reciprocal rstdOut of the standard deviation of the input self, and perform the SiLU operation on groupnormOut to obtain the final output out.
  • Formula:
    • GroupNorm: Assume E[x]=xˉE[x] = \bar{x} indicates the mean value of xx, and Var[x]=1ni=1n(xiE[x])2Var[x] = \frac{1}{n} * \sum_{i=1}^n(x_i - E[x])^2 indicates the variance of xx. Then:
    {groupnormOut=xE[x]Var[x]+epsγ+βmeanOut=E[x]rstdOut=1Var[x]+eps\left\{ \begin{array} {rcl} groupnormOut& &= \frac{x - E[x]}{\sqrt{Var[x] + eps}} * \gamma + \beta \\ meanOut& &= E[x]\\ rstdOut& &= \frac{1}{\sqrt{Var[x] + eps}}\\ \end{array} \right.
    • Silu:
    out=groupnormOut1+egroupnormOutout = \frac{groupnormOut}{1+e^{-groupnormOut}}
[object Object]

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

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

    • self (aclTensor*, computation input): xx in the [object Object] computation formula. The dimensions must be greater than one and less than or equal to eight. The can be ND. are supported.
      • [object Object]Atlas inference series products[object Object]: The data type can be FLOAT16 or FLOAT.
      • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: The data type can be FLOAT16, FLOAT, or BFLOAT16.
    • gamma (aclTensor*, computation input): (optional) γ\gamma in the [object Object] computation formula. The shape is 1D. The number of elements must be the same as that of the first dimension of the input selfself. The can be ND. are supported.
      • [object Object]Atlas inference series products[object Object]: The data type can be FLOAT16 or FLOAT.
      • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: The data type can be FLOAT16, FLOAT, or BFLOAT16.
    • beta (aclTensor*, computation input): (optional) β\beta in the [object Object] computation formula. The shape is 1D. The number of elements must be the same as that of the first dimension of the input selfself. The can be ND. are supported.
      • [object Object]Atlas inference series products[object Object]: The data type can be FLOAT16 or FLOAT.
      • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: The data type can be FLOAT16, FLOAT, or BFLOAT16.
    • group (int, computation input): INT32 or INT64 constant, indicating that the first dimension of the input selfself is divided into groups.
    • eps (double, computation input): DOUBLE constant, epseps in the [object Object] and [object Object] computation formulas.
    • out (aclTensor*, computation output): output tensor. The data type and shape are the same as those of selfself. The can be ND. are supported.
      • [object Object]Atlas inference series products[object Object]: The data type can be FLOAT16 or FLOAT.
      • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: The data type can be FLOAT16, FLOAT, or BFLOAT16.
    • meanOut (aclTensor*, computation output): output tensor. The shape is [object Object], where [object Object] is the same as the 0th dimension of selfself. The can be ND. are supported.
      • [object Object]Atlas inference series products[object Object]: The data type is the same as that of self.
      • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: The data type is the same as that of self.
    • rstdOut (aclTensor*, computation output): output tensor. The shape is [object Object], where [object Object] is the same as the 0th dimension of selfself. The can be ND. are supported.
      • [object Object]Atlas inference series products[object Object]: The data type is the same as that of self.
      • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: The data type is the same as that of self.
    • workspaceSize (uint64_t*, output): size of the workspace to be allocated on the device.
    • executor (aclOpExecutor **, output): operator executor, containing the operator computation process.
  • Returns:

    aclnnStatus: status code. For details, see .

[object Object]
[object Object]
  • Parameters:

    • workspace (void*, input): address of the workspace to be allocated on the device.
    • workspaceSize (uint64_t, input): size of the workspace to be allocated on the device, which is obtained by calling the first-phase API aclnnGroupNormSiluGetWorkspaceSize.
    • executor (aclOpExecutor*, input): operator executor, containing the operator computation process.
    • stream (aclrtStream, input): stream for executing the task.
  • Returns:

    aclnnStatus: status code. For details, see .

[object Object]

None

[object Object]

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

[object Object]