Description: Calculates parameters in ModulateBackward backpropagation and updates gradients.
Formula:
If the shape of the input self is [B, L, D], the calculation formula is as follows: The formulas are as follows:
Symbol description:
- : element-wise multiplication
- : summation operation, performed along the sequence dimension (that is, dim = 1)
- : subscripts, indicating the tensor dimension indices (commonly Batch, Length, and Dimension)
- : broadcasting (expanding) the scale tensor along the sequence dimension
Each operator has calls. First, aclnnModulateBackwardGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnModulateBackward is called to perform 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]
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 compute:
- aclnnModulateBackward defaults to a deterministic implementation.
scale and shift are two-dimensional vectors. The first dimension must have the same size as the first dimension of the input's shape, and the second dimension must have the same size as the third dimension of the input's shape.
The shape of the input gradoutput must be the same as that of the input.
The following example is for reference only. For details, see .