Maps a 4D NHWC tensor to a 2D column matrix using the im2col transformation
It first decomposes the (m, k) matrix into ((n, out_h, out_w), (k_h, k_w, c)), then applies
the convolution parameters to calculate the position in the input tensor for that kernel element.
Layout for a spatial (i.e. NHWC) tensor. Bounds check only applies to spatial dimensions, not
channel or batch (because these are implicitly checked in the layouts used with spatial tensors).