[object Object]

[object Object][object Object]undefined
[object Object]
  • API description: Applies 2D bilinear anti-aliasing upsampling to an input signal composed of several input channels.

  • Formula: For a 2D interpolation point (N,C,H,W)(N, C, H, W), the interpolation I(N,C,H,W)I(N, C, H, W) may be represented 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={(input.dim(2)1)/(outputSize[0]1)alignCorners=true1/scalesHalignCorners=false&scalesH>0input.dim(2)/outputSize[0]otherwisescaleH =\begin{cases} (input.dim(2)-1) / (outputSize[0]-1) & alignCorners=true \\ 1 / scalesH & alignCorners=false\&scalesH>0\\ input.dim(2) / outputSize[0] & otherwise \end{cases} scaleW={(input.dim(3)1)/(outputSize[1]1)alignCorners=true1/scalesWalignCorners=false&scalesW>0input.dim(3)/outputSize[1]otherwisescaleW =\begin{cases} (input.dim(3)-1) / (outputSize[1]-1) & alignCorners=true \\ 1 / scalesW & alignCorners=false\&scalesW>0\\ input.dim(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}
[object Object]

Each operator has calls. First, aclnnUpsampleBilinear2dAAGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnUpsampleBilinear2dAA 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:

    HeightoftheinputshapeH/outputSizeH<=50Height of the input shape H/outputSize_H <= 50 WidthoftheinputshapeW/outputSizeW<=50Width of the input shape W/outputSize_W <= 50
  • The input, outputSize, scalesH, and scalesW parameters must meet the following requirements:

    outputSize_H=floor(input_HscalesH)outputSize\_H = floor(input\_H * scalesH) outputSize_W=floor(input_WscalesW)outputSize\_W = floor(input\_W * scalesW)
  • Deterministic computation:

    • aclnnUpsampleBilinear2dAA defaults to a deterministic implementation.
[object Object]

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

[object Object]