[object Object]

[object Object][object Object]undefined
[object Object]
  • API description: Applies the trilinear interpolation algorithm to upsample the input signal composed of several input channels.
  • Formula:
    • Core algorithm logic:
      1. Scale the destination image to the same size as the source image.
      2. Calculate points of the scaled destination image and points of adjacent source images.
      3. 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:scale_d={(self.dim[2]1)/(outputSize[0]1)alignCorners=true1/scales_dalignCorners=false&scales_d>0self.dim[2]/outputSize[0]alignCorners=falsescale\_d =\begin{cases} (self.dim[2]-1) / (outputSize[0]-1) & alignCorners=true \\ 1 / scales\_d & alignCorners=false\&scales\_d>0\\ self.dim[2] / outputSize[0] & alignCorners=false \end{cases} scale_h={(self.dim[3]1)/(outputSize[1]1)alignCorners=true1/scales_halignCorners=false&scales_h>0self.dim[3]/outputSize[1]alignCorners=falsescale\_h =\begin{cases} (self.dim[3]-1) / (outputSize[1]-1) & alignCorners=true \\ 1 / scales\_h & alignCorners=false\&scales\_h>0\\ self.dim[3] / outputSize[1] & alignCorners=false \end{cases} scale_w={(self.dim[4]1)/(outputSize[2]1)alignCorners=true1/scales_walignCorners=false&scales_w>0self.dim[4]/outputSize[2]alignCorners=falsescale\_w =\begin{cases} (self.dim[4]-1) / (outputSize[2]-1) & alignCorners=true \\ 1 / scales\_w & alignCorners=false\&scales\_w>0\\ self.dim[4] / outputSize[2] & alignCorners=false \end{cases} 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:x={xscale_dalignCorners=trueMAX(0,(x+0.5)scale_d0.5)alignCorners=falsex' =\begin{cases} x * scale\_d & alignCorners=true \\ MAX(0,{(x+0.5)*scale\_d-0.5}) & alignCorners=false \end{cases} y={yscale_halignCorners=trueMAX(0,(y+0.5)scale_h0.5)alignCorners=falsey' =\begin{cases} y * scale\_h & alignCorners=true \\ MAX(0,{(y+0.5)*scale\_h-0.5}) & alignCorners=false \end{cases} z={zscale_walignCorners=trueMAX(0,(z+0.5)scale_w0.5)alignCorners=falsez' =\begin{cases} z * scale\_w & alignCorners=true \\ MAX(0,{(z+0.5)*scale\_w-0.5}) & alignCorners=false \end{cases}
      • Denoted:

        x0=int(x),x1=int(x)+1,lambda0=x1x,lambda1=1lambda0x_{0} =int(x'),x_{1} =int(x')+1, lambda_{0} = x_{1}-x', lambda_{1} = 1-lambda_{0} y0=int(y),y1=int(y)+1,lambdb0=y1y,lambdb1=1lambdb0y_{0} =int(y'),y_{1} =int(y')+1, lambdb_{0} = y_{1}-y', lambdb_{1} = 1-lambdb_{0} z0=int(z),z1=int(z)+1,lambdc0=z1z,lambdc1=1lambdc0z_{0} =int(z'),z_{1} =int(z')+1, lambdc_{0} = z_{1}-z', lambdc_{1} = 1-lambdc_{0}
      • Then:

        V(px,y,z)=V(px0,y0,z0)lambda0lambdb0lambdc0+V(px0,y0,z1)lambda0lambdb0lambdc1+V(px0,y1,z0)lambda0lambdb1lambdc0+V(px0,y1,z1)lambda0lambdb1lambdc1+V(px1,y0,z0)lambda1lambdb0lambdc0+V(px1,y0,z1)lambda1lambdb0lambdc1+V(px1,y1,z0)lambda1lambdb1lambdc0+V(px1,y1,z1)lambda1lambdb1lambdc1{V(p_{x, y, z})} = {V(p_{x0, y0, z0})} * {lambda_{0}} * {lambdb_{0}} * {lambdc_{0}} + {V(p_{x0, y0, z1})} * {lambda_{0}} * {lambdb_{0}} * {lambdc_{1}} + {V(p_{x0, y1, z0})} * {lambda_{0}} * {lambdb_{1}} * {lambdc_{0}} + {V(p_{x0, y1, z1})} * {lambda_{0}} * {lambdb_{1}} * {lambdc_{1}} + {V(p_{x1, y0, z0})} * {lambda_{1}} * {lambdb_{0}} * {lambdc_{0}} + {V(p_{x1, y0, z1})} * {lambda_{1}} * {lambdb_{0}} * {lambdc_{1}} + {V(p_{x1, y1, z0})} * {lambda_{1}} * {lambdb_{1}} * {lambdc_{0}} + {V(p_{x1, y1, z1})} * {lambda_{1}} * {lambdb_{1}} * {lambdc_{1}}
[object Object]

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.

[object Object]
[object Object]
[object Object]
  • Parameters:

    [object Object]
    • [object Object]Atlas inference products[object Object]:

      • The data type of the input parameter [object Object] supports only FLOAT32 and FLOAT16. inf and -inf inputs are not supported.
      • The data type of the output parameter [object Object] supports only FLOAT32 and FLOAT16.
    • [object Object]Atlas training products[object Object]:

      The data types of the input parameter [object Object] and output parameter [object Object] support FLOAT32, FLOAT16, and DOUBLE.

  • Returns:

    aclnnStatus: status code. For details, see .

    The first-phase API implements input parameter verification. The following errors may be thrown.

    [object Object]
[object Object]
  • Parameters:

    [object Object]
  • Returns:

    aclnnStatus: status code. For details, see .

[object Object]
  • The downscaling factor for input data must be less than or equal to 50. That is, depthDofoutputshape/outputSize[0]depth D of output shape/outputSize[0], heightHofoutputshape/outputSize[1]height H of output shape/outputSize[1], and widthWofoutputshape/outputSize[2]width W of output shape/outputSize[2] must be less than or equal to 50.
  • 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 memory usage must be less than 60 GB. The memory size can be calculated according to the following formula:

      NC(self_Dself_Hself_W+out_Dout_Hout_W+self_Dself_Hout_W+self_Dout_Hout_W)sizeof(float)<60102410241024N * C * (self\_D * self\_H * self\_W + out\_D * out\_H * out\_W + self\_D * self\_H * out\_W + self\_D * out\_H * out\_W) * sizeof(float) < 60 * 1024 * 1024 * 1024

      Where,

      • 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

  • Deterministic computing:
    • aclnnUpsampleTrilinear3d defaults to a deterministic implementation.
[object Object]

The following example is for reference only. For details, see .

[object Object]