I created a fake image input, which contains 16 smaller blocks, each in the shape 32x32.
This would correspond to the input you are already dealing with.
The slice_image method uses unfold to  create a tensor of [16, 1, 32, 32] which can be called e.g. in Dataset.__getitem__.
Since the Dataset already returns a batch of images (of the “small” 32x32 images), you would have to reshape the final data tensor, if you are using a DataLoader, since it would add another batch dimension to it.