Subsampling a tensor

I want to subsample a tensor of size HXW (both H and W divisible by two), to obtain 4 tensors of size (H/2, W/2) such that these 4 tensors cover the whole original tensor. Meaning of the 4 tensors, first has top-left values of every 2x2 box in original tensor, second has top right, third bottom left and fourth bottom right.
How to implement this?

look at unfold: http://pytorch.org/docs/master/tensors.html?highlight=unfold#torch.Tensor.unfold

You can do what you want with two unfolds (first unfold in dimension 0 and second unfold in dimension 1)