[object Object]

[object Object][object Object]undefined
[object Object]
  • API description: Applies the nearest neighbor interpolation algorithm to upsample the input signal composed of several input channels. If the input shape is (N, C, D, H, W), the output shape is (N, C, outputSize[0], outputSize[1], outputSize[2]).
  • Formulas:
    • Core algorithm logic:
      1. Map each point of the target image back to the original image to obtain a coordinate with a decimal point.
      2. Based on the floating-point coordinate, calculate the nearest point in the original image, and directly copy the value of the latter to the former.
    • Calculation logic:dsrc=min(floor(ddst/scalesD),self_D1), scalesD=outputSize[0]/self_Dd_{src} = min(floor(d_{dst} / scalesD), self\_D - 1), \ scalesD = outputSize[0] / self\_D hsrc=min(floor(hdst/scalesH),self_H1), scalesH=outputSize[1]/self_Hh_{src} = min(floor(h_{dst} / scalesH), self\_H - 1), \ scalesH = outputSize[1] / self\_H wsrc=min(floor(wdst/scalesW),self_W1), scalesW=outputSize[2]/self_Ww_{src} = min(floor(w_{dst} / scalesW), self\_W - 1), \ scalesW = outputSize[2] / self\_W out(N,C,ddst,hdst,wdst)=self(N,C,dsrc,hsrc,wsrc)out(N, C, d_{dst},h_{dst}, w_{dst}) = self(N, C, d_{src},h_{src}, w_{src})
[object Object]

Each operator has calls. First, aclnnUpsampleNearest3dGetWorkspaceSize is called to obtain the input parameters and compute the required workspace size based on the process. Then, aclnnUpsampleNearest3d is called to perform computation.

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

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

      The data types of the input parameter self and output parameter out do not support BFLOAT16, DOUBLE, or UINT8.

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

      The data types of the input parameter self and output parameter out do not support BFLOAT16 or UINT8.

    • [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 types of the input parameter self and output parameter out do not support UINT8.

  • 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]
  • The parameters self, outputSize, scalesD, scalesH, and scalesW must meet the following restrictions:

    outputSize_D=floor(self_DscalesD)outputSize\_D = floor(self\_D * scalesD) outputSize_H=floor(self_HscalesH)outputSize\_H = floor(self\_H * scalesH) outputSize_W=floor(self_WscalesW)outputSize\_W = floor(self\_W * scalesW)
  • Deterministic computation:

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

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

[object Object]