Skip to content
fn

avg_pool1d_forward_f32

void avg_pool1d_forward_f32(const float * x, float * y, int B, int C, int L, int KL, int OL, int stride_l, int pad_l, bool count_include_pad)

Single-precision 1-D average-pool forward with count-include-pad semantics.

Every output cell is the mean of its KL-wide window with the divisor fixed at KL regardless of how many positions fall on padding (pad values contribute 0 to the sum but still count toward the divisor). This matches the count-include-pad convention used by the reference framework's default AvgPool1d.

Math

x_{b,c,\,o\cdot \text{stride\_l} + k - \text{pad\_l}}.$$

Parameters

xconst float*
Input tensor of shape (B, C, L).
yfloat*
Output tensor of shape (B, C, OL).
B, C, Lint
Layout extents of x.
KLint
Pool window length and (count-include-pad) divisor.
OLint
Spatial extent of y.
stride_l, pad_lint
Window stride and symmetric zero-pad.