[object Object]

[object Object][object Object]undefined
[object Object]
  • API function: For the input channel of the input signal, the 2D max pooling operation is provided to output the pooled value out and index indices (calculated based on the mask semantics, which refers to the mask information that records the position of the maximum value during pooling).

  • 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)
    • For the shape inference 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]
    • For the shape inference of indices tensor:

      [N,C,Hindices,Windices]=[N,C,kh×kw,(Hout×Wout16+1)×2×16][N, C, H_{indices}, W_{indices}]=[N,C,k_h \times k_w, (\lceil{\frac{H_{out} \times W_{out}}{16}}\rceil+1) \times 2 \times 16]
[object Object]

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

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

    [object Object]
    • [object Object]Atlas inference products[object Object]: The data type can be FLOAT.
    • [object Object]Atlas training products[object Object]: The data type cannot be BFLOAT16.
  • 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:

    • aclnnMaxPool2dWithMask defaults to a deterministic implementation.
  • The input data does not support NaN and -Inf.

  • [object Object]Atlas training products[object Object]: When the input data is FLOAT, the data is converted to FLOAT16 for computation. As a result, the accuracy drops to some extent.

  • [object Object]Atlas inference products[object Object]: When ceilMode is set to True, the following stride scenarios are not supported:

sh>=(Hin+padding_size)/(Hout1)s_h >= (H_{in} + padding\_size) / (H_{out} - 1)

sw>=(Win+padding_size)/(Wout1)s_w >= (W_{in} + padding\_size) / (W_{out} - 1)

[object Object]

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

[object Object]