In your code, patches has a size of: torch.Size([1, 49152, 225]). I may just not be understanding exactly how unfold/fold works, but I’m not sure how I would use that with the steps I have below as it’s a single large tensor and not a list of patches?
I’m doing this with my model and the tiles:

Split the image into tiles.
Run each tile through a new copy of the model for a set number of iterations.
Put all the tiles back together, maybe save the output, then split the output into tiles again.
Repeat steps 2 and 3 for a set number of iterations.

The full code can be found here: https://gist.github.com/ProGamerGov/e64fcb309274c2946f5a9a679ed45669 6