Skip to content
fn

avg_pool3d_forward_f32

void avg_pool3d_forward_f32(const float * x, float * y, int B, int C, int D, int H, int W, int KD, int KH, int KW, int OD, int OH, int OW, int sd, int sh, int sw, int pd, int ph, int pw, bool count_include_pad)

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

Each output voxel is the mean of its KD × KH × KW window with divisor fixed at KD * KH * KW; padded positions contribute 0 to the sum but still count toward the divisor.

Math

\sum_{kd,kh,kw} x_{b,c, id, ih, iw},$$ with $id = od\cdot\text{sd} + kd - \text{pd}$, similarly for $ih, iw$.

Parameters

xconst float*
Input tensor of shape (B, C, D, H, W).
yfloat*
Output tensor of shape (B, C, OD, OH, OW).
B, C, D, H, Wint
Layout extents of x.
KD, KH, KWint
Window depth, height, width. Product is the count-include-pad divisor.
OD, OH, OWint
Output spatial extents.
sd, sh, sw, pd, ph, pwint
Window strides and symmetric zero-pads on each axis.