Skip to content
fn

adaptive_max_pool1d_op

→TensorImplPtr
int adaptive_max_pool1d_op(const int & x, int OL)

Python wrappers

Public Python APIs implemented by this engine symbol.

One-dimensional adaptive max-pool to a fixed output length.

Reduces the length axis of a 3-D input to exactly OL positions by taking the maximum over each contiguous segment. When OL == 1 this is global max pooling along the sequence.

Parameters

xTensorImplPtr
Input of shape (B, C, L).
OLint
Target output length. Must satisfy L % OL == 0.

Returns

TensorImplPtr

Output of shape (B, C, OL).

Raises

ShapeMismatch
If x is not 3-D.
not_implemented
If L is not evenly divisible by OL (non-uniform partitioning is not yet supported).