fn
im2col_1d_f32
void im2col_1d_f32(const float * x, float * cols, int C, int L, int KL, int OL, int stride_l, int pad_l, int dilation_l)Single-precision 1-D im2col unfold.
Unfolds each length- receptive field of a 1-D feature map into a column of a 2-D matrix so that conv1d can be expressed as a single GEMM. Out-of-bounds positions (from padding or dilation) are written as zero.
Math
For each output index , channel and kernel offset : with zero for out-of-bounds positions.
Parameters
xconst float*Input tensor, shape (row-major).
colsfloat*Output column matrix, shape .
CintChannel count.
LintInput spatial length.
KLintKernel length.
OLintOutput spatial length.
stride_l, pad_l, dilation_lintConvolution stride / zero-padding / dilation along the spatial axis.
Notes
Memory layout assumes the standard NCHW-style channel-first convention, with the batch dimension handled at the caller (loop over ).