Skip to content
fn

im2col_3d_f32

void im2col_3d_f32(const float * x, float * cols, int C, int D, int H, int W, int KD, int KH, int KW, int OD, int OH, int OW, int stride_d, int stride_h, int stride_w, int pad_d, int pad_h, int pad_w, int dilation_d, int dilation_h, int dilation_w)

Single-precision 3-D im2col unfold.

Unfolds a volumetric feature map xx of shape (C,D,H,W)(C, D, H, W) into a column matrix of shape (C⋅KD⋅KH⋅KW,OD⋅OH⋅OW)(C \cdot K_D \cdot K_H \cdot K_W, O_D \cdot O_H \cdot O_W). Used by conv3d (e.g., for video / medical-imaging models). Out-of-bounds positions are zero-padded.

Parameters

xconst float*
Input tensor, shape (C,D,H,W)(C, D, H, W) row-major.
colsfloat*
Output column matrix.
Cint
Channel count.
D, H, Wint
Input depth / height / width.
KD, KH, KWint
Kernel depth / height / width.
OD, OH, OWint
Output depth / height / width.
stride_d, stride_h, stride_wint
Per-axis strides.
pad_d, pad_h, pad_wint
Per-axis zero-padding.
dilation_d, dilation_h, dilation_wint
Per-axis dilation.

Notes

Memory layout is channel-first (NCDHW); batch dimension is iterated by the caller.