Solved by vainaijr in post #2 
              
              
                is unfold a way to do this, but I get a bit different result when I use unfold 
for example if I want all (2x3) blocks 
import torch.nn as nn
x = torch.randn(1, 1, 5, 5)
x

tensor([[[[-0.0197,  1.0647, -0.2223,  0.6515,  0.4126],
          [ 0.2328,  0.3959, -0.2910, -0.3321, -0.7934],
          [-0…