This API is used to implement the backpropagation of 1D convolution with the input and output dimensions being T** (time or spatial dimension), B (batch), and C (channel).
The calculation formula is as follows: Assume that the shape of the input of the Conv_tbc forward propagation is , the shape of the output gradient is , the shape of the convolution kernel is , and the shape of the bias is . During backpropagation, the input padding is . The relationship between the preceding parameters is as follows:
The backpropagation of convolution needs to calculate the gradients of the forward input tensor (corresponding to the input in the function prototype), convolution kernel weight tensor (corresponding to the weight in the function prototype), and bias (corresponding to the bias in the function prototype).
Gradient with respect to , (corresponding to the gradInput parameter in the function prototype):
indicates the batch size, indicates the number of channels, indicates the time or spatial dimension, and indicates the loss function. indicates the gradient of the output tensor to (corresponding to the self parameter in the function prototype).
Gradient with respect to , (corresponding to the gradWeight parameter in the function prototype):
Gradient with respect to , (corresponding to the gradBias parameter in the function prototype):
Each operator has calls. You must call aclnnConvTbcBackwardGetWorkspaceSize to obtain the workspace size required for computation and the executor that contains the operator computation process, and then call aclnnConvTbcBackward to perform the computation.
Parameters
[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]
- Deterministic computation:
- aclnnConvTbcBackward defaults to a non-deterministic implementation. You can call aclrtCtxSetSysParamOpt to enable deterministic computation.
The following example is for reference only. For details, see .