[object Object]

[object Object][object Object]undefined
[object Object]
  • API description: Applies the linear interpolation algorithm to upsample the input signal composed of several input channels. If the input shape is (N, C, L), the output shape is (N, C, outputSize).

  • Formula:

    • Core algorithm logic:
      1. Scale the destination image to the same size as the source image.
      2. Calculate points of the scaled destination image and points of adjacent source images.
      3. Calculate the weights from the adjacent points to the target points, and multiply and accumulate the weights to obtain the target point values.
    • Calculation logic: An image can be scaled by corner alignment (that is, based on the center point of the pixels in the upper left corner of the source image) or edge alignment (that is, based on the vertex in the upper left corner and two edges of the source image). The two modes differ in the scaling factor and coordinates. Then:scale={(self.dim[2]1)/(outputSize[0]1)alignCorners=true1/scalesalignCorners=false&scales>0self.dim[2]/outputSize[0]alignCorners=falsescale =\begin{cases} (self.dim[2]-1) / (outputSize[0]-1) & alignCorners=true \\ 1 / scales & alignCorners=false\&scales>0\\ self.dim[2] / outputSize[0] & alignCorners=false \end{cases} Therefore, for a point p (x) in a direction of the output, a point mapped back to the source image is denoted as q (x'). Then:x={xscale_halignCorners=trueMAX(0,(x+0.5)scale_h0.5)alignCorners=falsex' =\begin{cases} x * scale\_h & alignCorners=true \\ MAX(0,{(x+0.5)*scale\_h-0.5}) & alignCorners=false \end{cases}
      • Denoted:

        x0=int(x),x1=int(x)+1,lambda0=x1x,lambda1=1lambda0x_{0} =int(x'),x_{1} =int(x')+1, lambda_{0} = x_{1}-x', lambda_{1} = 1-lambda_{0}
      • Then:

        V(px)=V(px0)lambda0+V(px1)lambda1{V(p_{x})} = {V(p_{x0})} * {lambda_{0}} + {V(p_{x1})} * {lambda_{1}}
[object Object]

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

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

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

      The data types of the input parameter [object Object] and output parameter [object Object] do not support BFLOAT16.

  • 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]
  • If the data formats of the input parameter [object Object] and output parameter [object Object] are not ND or NCL, the input data is processed as NCL format by default.
  • Either outputSize or scales must be used.
    • If alignCorners is set to True:
      • If outputSize is equal to 1, the value of scales is 0.
      • In other cases, the values of self and outputSize are used, and scales=(self_L1)/(outputSize1)scales = (self\_L – 1)/(outputSize – 1).
    • If alignCorners is set to False:
      • If the value of scales is less than or equal to 0, the value of outputSize is used, that is, scales=(self_L/outputSize)scales = (self\_L / outputSize).
      • If the value of scales is greater than 0, the value of scales is used, that is, outputSize=[floor(self_Lscales)]outputSize = [floor(self\_L * scales)].
  • Deterministic computing:
    • aclnnUpsampleLinear1d defaults to a deterministic implementation.
[object Object]

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

[object Object]