API description: Applies the bicubic interpolation with anti-aliasing to upsample the input signal composed of several input channels. If the shape of the input tensor x is (N, C, H, W), then the shape of the output tensor out is (N, C, outputSize[0], outputSize[1]).
Formula: For a two-dimensional interpolation point , the interpolation may be represented as:
Where,
- i and j are index variables of .
- If , then ; otherwise, .
- If , then ; otherwise, .
- is the pixel value of the original image in .
- is the weight of the bicubic anti-aliasing interpolation, which is defined as follows:
Where,
- Anti-aliasing scenario: .
Each operator has calls. First, aclnnUpsampleBicubic2dAAGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnUpsampleBicubic2dAA is called to perform computation.
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 shape constraints of
[object Object]and[object Object]are as follows:The value of each dimension is less than or equal to 2^20.
The N and C axes of
[object Object]must be the same as those of[object Object]. The C, H, and W axes must be greater than 0.The memory usage must be less than 60 GB. The memory size can be calculated according to the following formula:
Where,
- N indicates the N axis of the input and output.
- C indicates the C axis of the input and output.
N * C * x_H < 2^31
- The downscaling factor for input data must be less than or equal to 50. That is, the "height H of input shape/outputSize[0]" and "width W of input shape/outputSize[1]" must be less than or equal to 50.
- The number of elements contained in outputSize must be 2, and the H and W axes of outputSize must be the same as those of the output shape.
- 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 less than or equal to 1, the value of the corresponding axis of scales is 0.
- In other cases, the values of the corresponding axes in x 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.
- If the value of the corresponding axis of outputSize is 0, the corresponding value of scales is 0.
- If the value of the corresponding axis of outputSize is not 0, .
- 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 .
- If the value of scalesH or scalesW is less than or equal to 0, the value of the corresponding axis in outputSize is used.
- When alignCorners is set to True:
- Deterministic computing:
- aclnnUpsampleBicubic2dAA defaults to a deterministic implementation.
The following example is for reference only. For details, see .