Skip to content
fn

adaptive_max_pool2d_op

→TensorImplPtr
int adaptive_max_pool2d_op(const int & x, int OH, int OW)

Python wrappers

Public Python APIs implemented by this engine symbol.

Two-dimensional adaptive max-pool to a fixed (OH, OW) grid.

Used in detection / segmentation models that must produce a fixed spatial grid regardless of input resolution (e.g. RoIAlign-style heads, classification networks fine-tuned on multi-scale data).

Parameters

xTensorImplPtr
Input of shape (B, C, H, W).
OH, OWint
Target output extents. Must satisfy H % OH == 0 and W % OW == 0.

Returns

TensorImplPtr

Output of shape (B, C, OH, OW).

Raises

ShapeMismatch
If x is not 4-D.
not_implemented
If any spatial axis is not evenly divisible by its target.