API description: Applies the linear interpolation algorithm to upsample the input signal composed of several input channels. If the input shape is (N, C, L), the output shape is (N, C, outputSize).
Formulas:
- Core algorithm logic:
- Each point in the target image is mapped back to the original image to obtain a coordinate with a decimal point.
- Based on the floating-point coordinate, the points of the original image before and after the target point are calculated.
- Calculate the weights from the adjacent points to the target points, and multiply and accumulate the weights to obtain the target point values.
- Calculation logic:
An image can be scaled by corner alignment (that is, based on the center point of the pixels in the upper left corner of the source image) or edge alignment (that is, based on the vertex in the upper left corner and two edges of the source image). The two modes differ in the scaling factor and coordinates. Then:
Therefore, for a point p (x) in a direction of the output, a point mapped back to the source image is denoted as q (x'). Then:
Denoted:
Then:
- Core algorithm logic:
Each operator has calls. First, aclnnUpsampleLinear1dGetWorkspaceSize is called to obtain the input parameters and compute the required workspace size based on the process. Then, aclnnUpsampleLinear1d is called to perform computation.
Parameters
[object Object][object Object]Atlas training products[object Object]:
The data types of the input parameter self and output parameter out do not support BFLOAT16.
Returns:
[object Object]: status code. For details, see .The first-phase API implements input parameter validation. The following error codes may be returned.
[object Object]
If the data formats of the input parameter self and output parameter out are not ND or NCL, the input data is processed as NCL format by default.
The self, outputSize, and scales parameters must meet the following requirements:
Deterministic computation:
- aclnnUpsampleLinear1d defaults to a deterministic implementation.
The following example is for reference only. For details, see .