[object Object]

[object Object][object Object]undefined
[object Object]
  • API function:

    • Provides two-dimensional (H, W) max pooling for the input channels of the input signal, and outputs the pooled value out and indices.
    • In the input dims, N represents the batch size, C represents the channel, D represents the depth, W represents the width, and H represents the height.
  • Formula:

    • Calculation formula of each element of the output tensor:

      out(Nj,Cj,h,w)=maxm[0,kH1],n[0,kW1]input(Ni,Cj,stride[0]×h+m,stride[1]×w+n)out(N_j, C_j, h, w) = \max\limits_{{m\in[0,k_{H}-1],n\in[0,k_{W}-1]}}input(N_i,C_j,stride[0]\times h + m, stride[1]\times w + n)
    • Formula for deducing the output tensor shape: (The shape of indices tensor is the same as that of out tensor.)

      [N,C,Hout,Wout]=[N,C,Hin+2×padding[0]dilation[0]×(kernelSize[0]1)1stride[0]+1,Win+2×padding[1]dilation[1]×(kernelSize[1]1)1stride[1]+1][N, C, H_{out}, W_{out}]=[N,C,\lfloor{\frac{H_{in}+2 \times {padding[0] - dilation[0] \times(kernelSize[0] - 1) - 1}}{stride[0]}}\rfloor + 1,\lfloor{\frac{W_{in}+2 \times {padding[1] - dilation[1] \times(kernelSize[1] - 1) - 1}}{stride[1]}}\rfloor + 1]
[object Object]

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

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

    [object Object]
    • [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 NHWC format is not supported, and the value of each element in dilation can only be 1.
  • Returns:

    [object Object]: 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:

    [object Object]: status code. For details, see .

[object Object]
  • Deterministic compute:

    • aclnnMaxPool2dWithIndices defaults to a deterministic implementation.
  • [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 input data does not support NaN and -Inf.
    • If ceilMode is set to True and sliding windows are all in the right padded region, the output result will be ignored.
[object Object]

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

[object Object]