[object Object]

[object Object][object Object]undefined
[object Object]
  • API description: Performs backpropagation of .
  • The calculation formula is as follows: For a two-dimensional interpolation point (N, C, H, W), the interpolation I(N, C, H, W) can be expressed as:I(N,C,H,W)=i=0kWj=0kHw(i)w(j)f(hi,wj)/i=0kWw(i)/j=0kHw(j){I(N, C, H, W)} = \sum_{i=0}^{kW}\sum_{j=0}^{kH}{w(i) * w(j)} * {f(h_i, w_j)}/\sum_{i=0}^{kW}w(i)/\sum_{j=0}^{kH}w(j) scaleH={(inputSize[2]1)/(outputSize[0]1)alignCorners=true1/scalesHalignCorners=false&scalesH>0inputSize[2]/outputSize[0]otherwisescaleH =\begin{cases} (inputSize[2]-1) / (outputSize[0]-1) & alignCorners=true \\ 1 / scalesH & alignCorners=false\&scalesH>0\\ inputSize[2] / outputSize[0] & otherwise \end{cases} scaleW={(inputSize[3]1)/(outputSize[1]1)alignCorners=true1/scalesWalignCorners=false&scalesW>0inputSize[3]/outputSize[1]otherwisescaleW =\begin{cases} (inputSize[3]-1) / (outputSize[1]-1) & alignCorners=true \\ 1 / scalesW & alignCorners=false\&scalesW>0\\ inputSize[3] / outputSize[1] & otherwise \end{cases}
    • The values are as follows:

      • kWkW and kHkH indicate the number of points that affect the interpolation point size in the W and H directions respectively.
      • If scaleH1scaleH ≥ 1, then kH=floor(scaleH)2+1kH = floor(scaleH) * 2 + 1; otherwise, kH=3kH = 3.
      • If scaleW1scaleW ≥ 1, then kW=floor(scaleW)2+1kW = floor(scaleW) * 2 + 1; otherwise, kW=3kW = 3.
      • f(hi,wj)f(h_i, w_j) is the pixel value of the original image in (hi,wj)(h_i, w_j).
      • w(i)w (i) and w(j)w(j) are the weights of the bilinear anti-aliasing interpolation in the W and H directions. The calculation formulas are as follows:w(i)={1hihhih<10otherwisew(i) = \begin{cases} 1 - |h_i - h| & |h_i -h| < 1 \\ 0 & otherwise \end{cases} w(j)={1wjwwjw<10otherwisew(j) = \begin{cases} 1 - |w_j - w| & |w_j -w| < 1 \\ 0 & otherwise \end{cases}
    • Assume that the output image out (h,w)(h, w) for forward interpolation is affected by the original image input (hi,wj)(h_i, w_j). Then:

      gradInput(hi,wj)+=gradOutput(h,w)w(i)w(j)gradInput(h_i,w_j) += gradOutput(h,w) * w(i) * w(j)
[object Object]

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

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

    [object Object]
  • 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]
[object Object]
  • Parameters

    [object Object]
  • Returns:

    [object Object]: status code. For details, see .

[object Object]
  • [object Object]Atlas A3 training products/Atlas A3 inference products[object Object] and [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]:

    In the input data scaling scenario, the scaling factor must be less than or equal to 50. That is:

    outputSizeH/outputshapeheightH<=50outputSize_H/output shape height H <= 50 outputSizeW/WidthWoftheoutputshape<=50outputSize_W/Width W of the output shape <= 50
  • The inputSize, outputSize, scalesH, and scalesW parameters must meet the following restrictions:

    outputSize_H=floor(inputSize_HscalesH)outputSize\_H = floor(inputSize\_H * scalesH) outputSize_W=floor(inputSize_WscalesW)outputSize\_W = floor(inputSize\_W * scalesW)
  • Deterministic computation:

    • [object Object]Atlas A3 training products/Atlas A3 inference products[object Object] and [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]: [object Object] defaults to a deterministic implementation.
    • Ascend 950PR/Ascend 950DT: [object Object] defaults to a non-deterministic implementation. You can call [object Object] to enable deterministic computation.
[object Object]

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

[object Object]