- API description: Applies the trilinear interpolation algorithm to upsample the input signal composed of several input channels.
- 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 images before and after the target image 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. For a three-dimensional interpolation point (N, C, D, H, W), the following formula is used:
Therefore, for a point p (x, y, z) in a direction of the output, a point mapped back to the source image is denoted as q (x', y', z'). Then:
Denoted:
Then:
- Core algorithm logic:
Each operator has calls. First, aclnnUpsampleTrilinear3dGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnUpsampleTrilinear3d is called to perform computation.
Parameters
[object Object][object Object]Atlas inference products[object Object]
- The data type of the input parameter self supports only FLOAT32 and FLOAT16. inf and -inf inputs are not supported.
- The data type of the output parameter out supports only FLOAT32 and FLOAT16.
[object Object]Atlas training products[object Object]:
The data types of the input parameter self and output parameter out support FLOAT32, FLOAT16, and DOUBLE.
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]
In the input data scaling scenario, the scaling factor must be less than or equal to 50. That is:
The shape constraints of self and out are as follows:
The value of each dimension is less than or equal to 2^20.
The N and C axes of out must be the same as those of self.
The memory usage must be less than 60 GB. The memory size can be calculated according to the following formula:
The values are as follows:
- N indicates the N axis of the input and output.
- C indicates the C axis of the input and output.
N * C * self_D * self_H < 2^31
out_W * out_H < 2^31
The parameters self, outputSize, scalesD, scalesH, and scalesW must meet the following constraints:
Deterministic computation:
- aclnnUpsampleTrilinear3d defaults to a deterministic implementation.
The following example is for reference only. For details, see .