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)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, LintLayout extents of
x.KLintPool window length and (count-include-pad) divisor.
OLintSpatial extent of
y.stride_l, pad_lintWindow stride and symmetric zero-pad.