[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Performs backpropagation of the operator.
[object Object]

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

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

    • gradOutput (aclTensor*, compute input): output gradient in the previous step during backpropagation, aclTensor on the device. The shape is the same as that of the forward output. are supported. The can be NCHW.
      • [object Object]Atlas training series products[object Object]: The data type can be FLOAT32 or FLOAT16.
      • [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 FLOAT32, FLOAT16, or BFLOAT16.
    • self(aclTensor*, compute input): input data of forward propagation, aclTensor on the device. are supported. The can be NCHW and must be the same as that of gradOutput.
      • [object Object]Atlas training series products[object Object]: The data type can be FLOAT32 or FLOAT16.
      • [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 FLOAT32, FLOAT16, or BFLOAT16.
    • indices (aclTensor *, compute input): indices of the forward output, aclTensor on the device. This tensor consists of bit values that mark the kernel positions where the maximum values are located (mask). The data type can only be INT8. The can be NCHW and must be the same as that of self.
    • kernelSize (aclIntArray*, compute input): size of the sliding window used in the pooling operation, aclIntArray on the host. The length can only be 1 or 2.
      • When the number of elements in kernelSize is 1, the window size is (kernelSize[0], kernelSize[0]).
      • When the number of elements in kernelSize is 2, the window size is (kernelSize[0], kernelSize[1]).
    • stride (aclIntArray*, compute input): stride of the window, aclIntArray on the host. The length can only be 0, 1, or 2. When the stride length is 0, the value of stride is equal to that of kernelSize.
      • When the number of elements in stride is 0, the stride length is the same as kernelSize.
      • When the number of elements in stride is 1, the stride length is (stride[0], stride[0]).
      • When the number of elements in stride is 2, the stride length is (stride[0], stride[1]).
    • padding (aclIntArray*, compute input): the number of layers of padding to be applied on each side, with negative infinity values used for padding. It is an aclIntArray on the host. The length can only be 1 or 2.
    • dilation (aclIntArray*, compute input): controls the stride between elements in the window. It is an aclIntArray on the host. The length can only be 1 or 2. The value can only be 1.
    • ceilMode (const bool, compute input): controls whether the output size of the pooling operation is rounded up. It is a boolean parameter on the host. If the value is True, the output shape is calculated by rounding up. If the value is False, the output shape is calculated by rounding down.
    • gradInput (aclTensor *, compute output): gradient of the output for backpropagation, aclTensor on the device. The shape is the same as that of self. The can be NCHW and must be the same as that of self.
      • [object Object]Atlas training series products[object Object]: The data type can be FLOAT32 or FLOAT16.
      • [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 FLOAT32, FLOAT16, or BFLOAT16.
    • 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 the first-phase API aclnnMaxPool2dWithMaskBackwardGetWorkspaceSize.
    • 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 compute:

    • aclnnMaxPool2dWithMaskBackward defaults to a non-deterministic implementation. You can call aclrtCtxSetSysParamOpt to enable deterministic compute.
  • The input data does not support NaN and -Inf.

  • [object Object]Atlas training series products[object Object]: When the input data is FLOAT, the data is converted to FLOAT16 for computation. As a result, the accuracy drops to some extent.

[object Object]

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

[object Object]