# Creating nonoverlapping patches from 3D data and reshape them back to the image

**URL:** <https://discuss.pytorch.org/t/creating-nonoverlapping-patches-from-3d-data-and-reshape-them-back-to-the-image/51210>\
**Category:** Uncategorized\
**Created:** [July 21, 2019, 5:22pm UTC](https://discuss.pytorch.org/t/creating-nonoverlapping-patches-from-3d-data-and-reshape-them-back-to-the-image/51210 "2019-07-21T17:22:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [July 21, 2019, 5:35pm UTC](https://discuss.pytorch.org/t/creating-nonoverlapping-patches-from-3d-data-and-reshape-them-back-to-the-image/51210/2 "2019-07-21T17:35:21Z")

</div>

In your last topic, I’ve posted a small example, how to get non-overlapping patches: [link](https://discuss.pytorch.org/t/creating-3d-dataset-dataloader-with-patches/50861/2).

Have a look at [this post](https://discuss.pytorch.org/t/patch-making-does-pytorch-have-anything-to-offer/33850/11) to see, how these patches can be transformed into the original input tensor.

Note, that your current input shape it not divisible without a remainder by 32, so you might want to add padding to the input before unfolding.

---

_[View the full topic](https://discuss.pytorch.org/t/creating-nonoverlapping-patches-from-3d-data-and-reshape-them-back-to-the-image/51210)._
