- Description: Performs backpropagation of . It backfills the gradient to the coordinates of the maximum value of each window and accumulates the gradients at the same coordinates.
Each operator has calls. First, aclnnMaxPool3dWithArgmaxBackwardGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnMaxPool3dWithArgmaxBackward is called to perform computation.
[object Object][object Object]
Parameters:
- gradOutput (aclTensor*, compute input): gradient tensor, aclTensor on the device. The shape is the same as that of the forward output. are supported. The can be ND. When the input is five dimensions, it is processed as NCDHW. When the input is four dimensions, it is padded with 1s in dimension zero and processed as NCDHW.
- [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): forward input tensor, aclTensor on the device. are supported. The can be ND. When the input is five dimensions, it is processed as NCDHW. When the input is four dimensions, it is padded with 1s in dimension zero and processed as NCDHW, same as that of gradOutput.
- [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): input tensor, aclTensor on the device. It indicates the index of the maximum element in the forward input. The can be NCDHW and must be the same as that of self. The shape is the same as that of gradOutput.
- [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 only be INT32.
- kernelSize (aclIntArray*, compute input): window size of max pooling. It is an aclIntArray on the host, indicating the pooling window size. The value is an array of the INT64 type. The length is 1 () or 3 ().
- stride (aclIntArray*, compute input): aclIntArray on the host, indicating the pooling stride. The value is an array of the INT64 type, with length 0 (), 1 (), or 3 ().
- padding (aclIntArray*, compute input): aclIntArray on the host, indicating the number of layers for padding 0s in the D, H, and W directions. The value is an INT64 array, with length 1 () or 3 ().
- dilation (aclIntArray*, compute input): aclIntArray on the host, indicating the stride of elements in the control window. The value is an INT64 array, with length 1 () or 3 (). The value can only be 1.
- ceilMode (bool, compute input): whether to round up the output shape derived during forward average pooling. The data type can be BOOL.
- gradInput (aclTensor *, compute output): reverse output tensor, aclTensor on the device. The shape is the same as that of self. The can be NCDHW and must be 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 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.
- gradOutput (aclTensor*, compute input): gradient tensor, aclTensor on the device. The shape is the same as that of the forward output. are supported. The can be ND. When the input is five dimensions, it is processed as NCDHW. When the input is four dimensions, it is padded with 1s in dimension zero and processed as NCDHW.
Returns:
[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 aclnnMaxPool3dWithArgmaxBackwardGetWorkspaceSize.
- executor (aclOpExecutor *, input): operator executor, containing the operator computation process.
- stream (aclrtStream, input): stream for executing the task.
Returns:
Deterministic compute:
- aclnnMaxPool3dWithArgmaxBackward defaults to a non-deterministic implementation. You can call aclrtCtxSetSysParamOpt to enable deterministic compute.
Function dimensions:
- The data type of indices can be INT32.
- The data format can be ND.
Description of unsupported types:
- DOUBLE: The instructions do not support DOUBLE.
- Empty tensors: Empty input and out are 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.
The following example is for reference only. For details, see .
[object Object]