Unfold a tensor

For non-overlapping patches the stride should equal the kernel size.
For a small example have a look at this post.
Based on your input shape and kernel size, you would need to pad the input tensor to properly reshape the patches back.