[object Object]

[object Object][object Object]undefined
[object Object]

Description: Performs backpropagation of .

[object Object]

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

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

    • dy (aclTensor*, computation input): input tensor, aclTensor on the device, and gradient of backpropagation. The shape must be greater than 1D, and the number of elements must be equal to N × C × HxW. The data type can be FLOAT32, FLOAT16, or BFLOAT16. The can be ND. are supported.

    • mean (aclTensor*, computation input): input tensor, aclTensor on the device, and second output of forward propagation, indicating the mean value of each group after input grouping. The number of elements must be equal to N × group. The data type can be FLOAT32, FLOAT16, or BFLOAT16, which is the same as that of gammagamma. [object Object] is the same as the 0th dimension of dydy. The can be ND. are supported.

    • rstd (aclTensor*, computation input): input tensor, aclTensor on the device, and third output of forward propagation, indicating the reciprocal of the standard deviation of each group after input grouping. The number of elements must be equal to N × group. The data type can be FLOAT32, FLOAT16, or BFLOAT16, which is the same as that of gammagamma. [object Object] is the same as the 0th dimension of dydy. The can be ND. are supported.

    • x (aclTensor*, computation input): input tensor, aclTensor on the device, and input xx of forward propagation. The shape must be greater than 1D. The data type can be FLOAT32, FLOAT16, or BFLOAT16. The can be ND. are supported.

    • gamma (aclTensor*, computation input): input tensor, aclTensor on the device, and scaling coefficient of each channel. The shape is 1D, and the number of elements must be equal to C. The data type can be FLOAT32, FLOAT16, or BFLOAT16. The can be ND. are supported.

    • beta (aclTensor*, computation input): input tensor, aclTensor on the device, and offset coefficient of each channel. The shape is 1D, and the number of elements must be equal to C. The data type can be FLOAT32, FLOAT16, or BFLOAT16, which is the same as that of gammagamma. The can be ND. are supported.

    • numGroups (int64_t, computation input): INT64 constant, which indicates that the C dimension of the input gradOut is divided into groups. The value of group must be greater than 0, C must be exactly divided by group, and the ratio cannot exceed 4000.

    • dataFormatOptional (char*, computation input): data format. The recommended value is NCHW.

    • swishScale (double, computation input): coefficient in the Swish computation formula. The recommended value is 1.0.

    • dgammaIsRequire (bool, computation input): indicates whether dgamma needs to be output. The recommended value is true.

    • dbetaIsRequire (bool, computation input): indicates whether dbeta needs to be output. The recommended value is true.

    • dxOut (aclTensor*, computation output): output tensor, aclTensor on the device, and gradient of x. The data type can be BFLOAT16, FLOAT16, or FLOAT. The data type and shape are the same as those of xx. The can be ND. are supported.

    • dgammaOut (aclTensor*, computation output): output tensor, aclTensor on the device, and gradient of gamma. The data type can be BFLOAT16, FLOAT16, or FLOAT. The data type and shape are the same as those of gammagamma. The can be ND. are supported.

    • dbetaOut (aclTensor*, computation output): output tensor, aclTensor on the device, and gradient of beta. The data type can be BFLOAT16, FLOAT16, or FLOAT. The data type and shape are the same as those of gammagamma. The can be ND. are supported.

    • 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 aclnnGroupNormSwishGradGetWorkspaceSize.
    • 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]
  • Deterministic computation
    • aclnnGroupNormSwishGrad defaults to a non-deterministic implementation. You can call aclrtCtxSetSysParamOpt to enable deterministic computation.
[object Object]

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

[object Object]