Skip to content
fn

adaptive_avg_pool1d_op

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

Python wrappers

Public Python APIs implemented by this engine symbol.

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

Reduces the length axis of a 3-D input to exactly OL positions by taking the arithmetic mean over each contiguous segment. Setting OL = 1 produces global average 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.