Is there a similar function to tf.space_to_batch and tf.batch_to_space?

It would be very helpful to have some functions to rearranges (permutes) blocks of spatial data into batch and then transform it back. I usually implement anything in a Convolution style efficiently with their help. In tensorflow, they are tf.nn.space_to_batch and tf.nn.batch_to_space.

Are there similar functions in pytorch? Or is there any way to implement such a function efficiently?

Thank you very much!