[object Object]

[object Object][object Object]undefined
[object Object]

Performs backpropagation of the operator.

  • Deduction formula of the input tensor:

    • When ceilMode is set to False, the H and W dimensions in the shape of the indices tensor are derived as follows:

      [Hout,Wout]=[Hin+padding_sizeHtop+padding_sizeHbottomdilation_size×(kh1)1sh+1,Win+padding_sizeWleft+padding_sizeWrightdilation_size×(kw1)1sw+1][H_{out}, W_{out}]=[\lfloor{\frac{H_{in}+ padding\_size_{Htop} + padding\_size_{Hbottom} - {dilation\_size \times(k_h - 1) - 1}}{s_h}}\rfloor + 1,\lfloor{\frac{W_{in}+ padding\_size_{Wleft} + padding\_size_{Wright} - {dilation\_size \times(k_w - 1) - 1}}{s_w}}\rfloor + 1]
    • When ceilMode is set to True, the H and W dimensions in the shape of the out tensor are derived as follows:

      [Hout,Wout]=[Hin+padding_sizeHtop+padding_sizeHbottomdilation_size×(kh1)1sh+1,Win+padding_sizeWleft+padding_sizeWrightdilation_size×(kw1)1sw+1][H_{out}, W_{out}]=[\lceil{\frac{H_{in}+ padding\_size_{Htop} + padding\_size_{Hbottom} - {dilation\_size \times(k_h - 1) - 1}}{s_h}}\rceil + 1,\lceil{\frac{W_{in}+ padding\_size_{Wleft} + padding\_size_{Wright} - {dilation\_size \times(k_w - 1) - 1}}{s_w}}\rceil + 1]
    • If the start position of the upper left corner of the sliding window is in the padding area below or on the right, or is out of the image (no valid value can be obtained), the sliding window result will be discarded. In this case, you need to subtract 1 from the shape of the corresponding spatial axis based on the preceding formula.

      {Hout=Hout1if (Hout1)sh>=Hin+padding_sizeHtopWout=Wout1if (Wout1)sw>=Win+padding_sizeWleft\begin{cases} H_{out}=H_{out} - 1& \text{if } (H_{out}-1)*s_h>=H_{in}+padding\_size_{Htop} \\ W_{out}=W_{out} - 1& \text{if } (W_{out}-1)*s_w>=W_{in}+padding\_size_{Wleft} \\ \end{cases}\\
[object Object]

Each operator has calls. First, aclnnMaxPool2dWithIndicesBackwardGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnMaxPool2dWithIndicesBackward 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 data types of gradOutput and self support FLOAT. The data format can be ND or NCHW. When the input is 3D, the value of CHW is used. The data type of indices supports INT32. Only dilation (1, 1) is supported.

  • 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:

    • aclnnMaxPool2dWithIndicesBackward defaults to a non-deterministic implementation. You can call aclrtCtxSetSysParamOpt to enable deterministic compute.
  • The input data does not support NaN and -Inf. The value of indices cannot exceed H_inW_inH\_in*W\_in in the formula and must be greater than or equal to 0.

[object Object]

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

[object Object]