- API description: Performs backpropagation of .
- Formula: For a 2D interpolation point , the interpolation may be represented as:
Where,
- and indicate the number of points that affect the interpolation point size in the W and H directions respectively.
- If , then ; otherwise, .
- If , then ; otherwise, .
- is the pixel value of the original image in .
- and are the weights of the bilinear anti-aliasing interpolation in the W and H directions. The calculation formulas are as follows:
Assume that the output image out for forward interpolation is affected by the original image input . Then:
Each operator has calls. First, aclnnUpsampleBilinear2dAABackwardGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnUpsampleBilinear2dAABackward is called to perform computation.
[object Object]
[object Object]
Parameters:
[object Object]
Returns:
aclnnStatus: status code. For details, see .
The first-phase API implements input parameter verification. The following errors may be thrown.
[object Object]
- The upscaling factor for input data must be less than or equal to 50. That is, both and must be less than or equal to 50.
- Either the H and W axes of the outputSize parameter or the scalesH and scalesW parameters can be used.
- When alignCorners is set to True:
- If the value of the corresponding axis of outputSize is equal to 1, the value of the corresponding axis of scales is 0.
- In other cases, the values of the corresponding axes in the input parameters inputSize and outputSize are used, and .
- If alignCorners is set to False:
- If the value of scalesH or scalesW is less than or equal to 0, the value of the corresponding axis in outputSize is used, that is, .
- If the value of scalesH or scalesW is greater than 0, the value of scalesH or scalesW is used. That is, the value of the corresponding axis of outputSize is or .
- When alignCorners is set to True:
- Deterministic computing:
- aclnnUpsampleBilinear2dAABackward defaults to a deterministic implementation.
The following example is for reference only. For details, see .
[object Object]