I stuck in one place, if I have a tensor like,
a = torch.randn(3, 3)

then how do I get, beginning index of each patch, if I extract all 2x2 patches from it, then I want [0, 0] for first patch, [0, 1] for 2nd patch, and so on, [1, 0] , [1, 1].
or in other words extract patches, along with location of patches in the original tensor.
for 1d patch I am able to extract location using, torch.where, but it does not work for >1d patch.