Skip to content
fn

max_pool3d_forward_f32

void max_pool3d_forward_f32(const float * x, float * y, int * argmax, 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)

Single-precision 3-D max-pool forward over an NCDHW input.

For every output voxel the kernel scans the corresponding KD × KH × KW window, writes the maximum into y, and stores the flat d*H*W + h*W + w index of the winner into argmax. Pad voxels are treated as -inf.

Shape

OD=⌊(D+2⋅pd−KD)/sd⌋+1\text{OD} = \lfloor (D + 2\cdot\text{pd} - \text{KD})/\text{sd}\rfloor + 1, analogously for OH,OW\text{OH}, \text{OW}.

Parameters

xconst float*
Input tensor of shape (B, C, D, H, W).
yfloat*
Output tensor of shape (B, C, OD, OH, OW).
argmaxint32_t*
Per-output winning flat 3-D index, shape (B, C, OD, OH, OW).
B, C, D, H, Wint
Layout extents of x.
KD, KH, KWint
Window depth, height, width.
OD, OH, OWint
Output spatial extents.
sd, sh, swint
Window strides along D, H, W.
pd, ph, pwint
Symmetric zero-pads along D, H, W.