[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, H, W), the output shape is (N, C, outputSize[0], outputSize[1]).
  • Formulas:hsrc=min(floor(hdstscalesH),H1), scalesH=self_H/outputSize[0]h_{src} = min(floor(h_{dst} * scalesH), H - 1), \ scalesH = self\_H / outputSize[0] wsrc=min(floor(wdstscalesW),W1), scalesW=self_W/outputSize[1]w_{src} = min(floor(w_{dst} * scalesW), W - 1), \ scalesW = self\_W / outputSize[1] out(N,C,hdst,wdst)=self(N,C,hsrc,wsrc)out(N, C, h_{dst}, w_{dst}) = self(N, C, h_{src}, w_{src})
[object Object]

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

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

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

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

  • 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 shape constraints of self and out are as follows:

    • The value of each dimension is less than or equal to 2^20.
    • The N and C axes of out must be the same as those of self.
    • The memory usage must be less than 60 GB. The memory size can be calculated according to the following formula:N(ceil(C/16)16)(self_Hself_W+out_Hout_W)sizeof(dtype)<60102410241024N * (ceil(C/16) * 16) * (self\_H * self\_W + out\_H * out\_W) * sizeof(dtype) < 60 * 1024 * 1024 * 1024 The values are as follows:
      • N indicates the N axis of the input and output.
      • C indicates the C axis of the input and output.
  • Deterministic computation:

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

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

[object Object]