[object Object]

[object Object][object Object]undefined
[object Object]
  • Function: Performs backpropagation of .

  • Formula:

    • Core forward 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={(inputSize[2]1)/(outputSize[0]1)alignCorners=true1/scales_dalignCorners=false&scales_d>0inputSize[2]/outputSize[0]alignCorners=falsescale\_d =\begin{cases} (inputSize[2]-1) / (outputSize[0]-1) & alignCorners=true \\ 1 / scales\_d & alignCorners=false\&scales\_d>0\\ inputSize[2] / outputSize[0] & alignCorners=false \end{cases} scale_h={(inputSize[3]1)/(outputSize[1]1)alignCorners=true1/scales_halignCorners=false&scales_h>0inputSize[3]/outputSize[1]alignCorners=falsescale\_h =\begin{cases} (inputSize[3]-1) / (outputSize[1]-1) & alignCorners=true \\ 1 / scales\_h & alignCorners=false\&scales\_h>0\\ inputSize[3] / outputSize[1] & alignCorners=false \end{cases} scale_w={(inputSize[4]1)/(outputSize[2]1)alignCorners=true1/scales_walignCorners=false&scales_w>0inputSize[4]/outputSize[2]alignCorners=falsescale\_w =\begin{cases} (inputSize[4]-1) / (outputSize[2]-1) & alignCorners=true \\ 1 / scales\_w & alignCorners=false\&scales\_w>0\\ inputSize[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}}
      • Assume that the output image out (x,y,z)(x, y, z) for forward interpolation is affected by the original image input (xi,yj,zk)(x_i, y_j, z_k). Then:

        gradInput(xi,yj,zk)+=gradOut(x,y,z)lambd(xi,yj,zk)gradInput(x_i,y_j,z_k) += gradOut(x,y,z) * lambd(x_i,y_j,z_k)
[object Object]

Each operator has calls. First, aclnnUpsampleTrilinear3dBackwardGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnUpsampleTrilinear3dBackward is called to perform computation.

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

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

      The data types of [object Object] and [object Object] do not support BFLOAT16.

  • 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 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(gradOut_DgradOut_HgradOut_W+gradInput_DgradInput_HgradInput_W+gradOut_DgradOut_HgradInput_W+gradOut_DgradInput_HgradInput_W)sizeof(float)<60102410241024N * C * (gradOut\_D * gradOut\_H * gradOut\_W + gradInput\_D * gradInput\_H * gradInput\_W + gradOut\_D * gradOut\_H * gradInput\_W + gradOut\_D * gradInput\_H * gradInput\_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 * gradOut_D * gradOut_H < 2^31

    • gradInput_W * gradInput_H < 2^31

  • Either the D/H/W axes of outputSize or scalesD/scalesH/scalesW must 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 scales=(inputSize1)/(outputSize1)scales = (inputSize – 1)/(outputSize – 1).
    • If alignCorners is set to False:
      • If the value of the input parameter scalesD, scalesH, or scalesW is less than or equal to 0, the value of the corresponding axis in the input parameter outputSize is used, that is, scales=(inputSize/outputSize)scales = (inputSize/outputSize).
      • If the value of scalesD, scalesH, or scalesW is greater than 0, the value of scalesD, scalesH, or scalesW is used. That is, the value of the corresponding axis of outputSize is floor(inputSize_DscalesD)floor(inputSize\_D * scalesD), floor(inputSize_HscalesH)floor(inputSize\_H * scalesH), or floor(inputSize_WscalesW)floor(inputSize\_W * scalesW).
  • Deterministic computing:
    • aclnnUpsampleTrilinear3dBackward defaults to a deterministic implementation.
[object Object]

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

[object Object]