Thanks ptrblck! In case of im2col (I couldn’t find the source code, but even if I find it I am afraid it is implemented in c++ and I won’t be able to understand it), if we pass a batch of N images, is it ran N times over each image using a for-loop? Also if we have more than one filters, will it require another for-loop? Or is im2col somehow cleverly vectorized so that it can handle tensors of shape (N, C, H, W) without for-loops (just a single matrix multiplication)?