Description: Performs pooling on the input feature map based on the region of interest (ROI). Each ROI is divided into pooled_h × pooled_w grids, and max pooling is performed on each grid. The pooling result and the one-dimensional index (argmax) of the maximum value in the channel are output.
Formulas:
The shape of the input feature map is , and the shape of the ROI tensor is . Each row indicates . The scalar parameters are , (spatial_scale), , and . The subscript indicates the ROI index, indicates the channel, and indicates the pooling grid.
ROI mapping to the feature map: The ROI coordinates are multiplied by spatial_scale to obtain the floating-point interval on the feature map.
If or , the value of for the ROI is all 0s, and the value of is all -1.
Bin step and range: Each pooling grid (ph, pw) corresponds to a bin in the ROI. The step and floating-point range are as follows:
The value is rounded and cropped to .
where . If or , the bin is empty, that is, and .
Pooling output and Argmax: Record and in the bin area.
(If is empty, the value is 0.)
is the position of the maximum value in the bin (the first value is obtained). If is empty, the value is -1.
Output shape:
[object Object]undefined
Each operator has calls. First, [object Object] is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, [object Object] is called to perform computation.
Parameters
[object Object]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]
- Deterministic computation:
[object Object]defaults to a deterministic implementation.
The following example is for reference only. For details, see . During actual call, use opgen to generate aclnnop/aclnn_roi_pooling_with_arg_max.h. If the generated header file or API signature is different, use the generated API.