Skip to content
fn

avg_pool1d_op

→TensorImplPtr
int avg_pool1d_op(const int & x, int KL, int stride_l, int pad_l, bool ceil_mode, bool count_include_pad)

Python wrappers

Public Python APIs implemented by this engine symbol.

One-dimensional average pooling over a batch of sequences.

Emits the arithmetic mean of each sliding window of length KL.

Parameters

xTensorImplPtr
Input of shape (B, C, L).
KLint
Window length.
stride_lint= None
Stride. 0 is a sentinel meaning "use KL". Default: 0.
pad_lint= None
Zero-padding added to both ends. Default: 0.

Returns

TensorImplPtr

Output of shape (B, C, L_out) where Lout=⌊(L+2p−KL)/s+1⌋L_\text{out} = \lfloor (L + 2 p - KL)/s + 1 \rfloor.