Apply the max roi pooling. [Girshick, 2015].

The input rois should be packed with the shape \((N, 5)\), where \(N\) is the number of RoIs, and each column takes \(5\) values for a sequence of \([i_{\text{batch}}, x_{\min}, y_{\min}, x_{\max}, y_{\max}]\).


x = dragon.range(18, dtype='float32').reshape((1, 2, 3, 3))
rois = dragon.constant([[0., 1., 1., 2.]], dtype='float32')
print([x, rois], pooled_h=1, pooled_w=1))
  • inputs (Sequence[dragon.Tensor]) – The tensor x and rois.
  • pooled_h (int, required) – The output height.
  • pooled_w (int, required) – The output width.
  • spatial_scale (float, optional, default=1.0) – The input scale to the size of rois.

dragon.Tensor – The output tensor.