How to implement the im2col like caffe during convolution?

Hello. Is there a function in pytorch can do im2col like caffe, in which we can also setup the convolution parameters?

This package has an im2col and col2im if you want: