fn
avg_pool2d_forward_f32
void avg_pool2d_forward_f32(const float * x, float * y, int B, int C, int H, int W, int KH, int KW, int OH, int OW, int stride_h, int stride_w, int pad_h, int pad_w)Single-precision 2-D average-pool forward with count-include-pad semantics.
Every output cell is the mean of its KH × KW window with divisor fixed
at KH * KW regardless of how many positions fall on padding; padded
positions contribute 0 to the sum but still count toward the divisor.
Math
with , similarly for .
Parameters
xconst float*Input tensor of shape
(B, C, H, W).yfloat*Output tensor of shape
(B, C, OH, OW).B, C, H, WintLayout extents of
x.KH, KWintWindow height and width.
KH * KW is the (count-include-pad) divisor.OH, OWintOutput spatial extents.
stride_h, stride_w, pad_h, pad_wintWindow stride and symmetric zero-pad on each axis.