[object Object]

[object Object][object Object]undefined
[object Object]
  • API description: Applies 2D bicubic upsampling to an input signal composed of several input channels. If the shape of the input tensor x is (N, C, H, W), then the shape of the output tensor out is (N, C, outputSize[0], outputSize[1]).

  • Formula: For a two-dimensional interpolation point (N,C,h,w)(N, C, h, w), the interpolation out(N,C,h,w)out(N, C, h, w) may be represented as:

    out(N,C,h,w)=i=03j=03W(i,j)f(hi,wj){out(N, C, h, w)}=\sum_{i=0}^{3}\sum_{j=0}^{3}{W(i, j)}*{f(h_i, w_j)} scaleH={(self.dim(2)1)/(outputSize[0]1)alignCorners=true1/scalesHalignCorners=false&scalesH>0self.dim(2)/outputSize[0]otherwisescaleH =\begin{cases} (self.dim(2)-1) / (outputSize[0]-1) & alignCorners=true \\ 1 / scalesH & alignCorners=false\&scalesH>0\\ self.dim(2) / outputSize[0] & otherwise \end{cases} scaleW={(self.dim(3)1)/(outputSize[1]1)alignCorners=true1/scalesWalignCorners=false&scalesW>0self.dim(3)/outputSize[1]otherwisescaleW =\begin{cases} (self.dim(3)-1) / (outputSize[1]-1) & alignCorners=true \\ 1 / scalesW & alignCorners=false\&scalesW>0\\ self.dim(3) / outputSize[1] & otherwise \end{cases}

    Where,

    • i and j are index variables of W(i,j)W(i, j).
    • 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,j)W(i, j) is the weight of the bicubic anti-aliasing interpolation, which is defined as follows:W(d)={(a+2)d3(a+3)d2+1d1ad35ad2+8ad4a1<d<20otherwiseW(d) =\begin{cases} (a+2)|d|^3-(a+3)|d|^2+1 & |d|\leq1 \\ a|d|^3-5a|d|^2+8a|d|-4a & 1<|d|<2 \\ 0 & otherwise \end{cases} Where,
      • a=0.75a=-0.75
      • d=(h,w)(hi,wj)d = |(h, w) - (h_i, w_j)|
[object Object]

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

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

    [object Object]
    • [object Object]Atlas 200I/500 A2 inference products[object Object], [object Object]Atlas inference products[object Object], and [object Object]Atlas training products[object Object]:

      • Data format: The [object Object] and [object Object] parameters do not support BFLOAT16.
      • Data type: The [object Object] and [object Object] parameters do not support NHWC.
    • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]:

      The data formats of [object Object] and [object Object] do not support NHWC.

  • 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:

      (self_Hself_W+out_Hout_W+self_Hout_W)NCsizeof(float)<60102410241024(self\_H * self\_W + out\_H * out\_W + self\_H * out\_W) * N * C * 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_H < 2^31

  • Either the H and W axes of the outputSize parameter or the scalesH and scalesW parameters can 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 self and outputSize are used, and scales=(outputSize1)/(self1)scales = (outputSize – 1)/(self – 1).
    • If alignCorners is set to False:
      • If the value of scalesH or scalesW is less than or equal to 0, the value of the corresponding axis in outputSize is used, that is, scales=(outputSize/self)scales = (outputSize/self).
      • If the value of scalesH or scalesW is greater than 0, the value of scalesH or scalesW is used. That is, the value of the corresponding axis of outputSize is floor(self_HscalesH)floor(self\_H * scalesH) or floor(self_WscalesW)floor(self\_W * scalesW).
  • Deterministic computing:
    • aclnnUpsampleBicubic2d defaults to a deterministic implementation.
[object Object]

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

[object Object]