title: Extracting 3D patches from 3D images in both overlapping and nonoverlapping process and recovering the image back
body: <p>I am working with 172x220x156 shaped 3D images. To feed the image into the network for output I need to extract patches of size 32x32x32 from the image and add those back to get the image again. 
  Since my image dimension are not multiples of patch size thus I have to get overlapping patches. 
  I want to know how to do that. </p>
  
  <p>I am working in PyTorch, there are some options like <code>unfold</code> and <code>fold</code> but I am not sure how they work.</p>