Solved by ptrblck in post #2 
              
              
                You could try out your method by creating each window patch via unfold, apply your method, and reshape it to the output shape. 
This post gives you an example of this approach. 
Note that this approach will most likely be slow, but might be good enough to experiment with your method. If you need a m…