tensor.unfold might be what you’re looking for:
A = torch.tensor([[ 0.4257,  0.7940, -1.2986],
                  [ 0.3243, -1.3812, -1.0442],
                  [-0.3122,  1.2312,  0.9811]])

M = A.unfold(dimension=0, size=2, step=1).unfold(dimension=1, size=2, step=1)
M = M.contiguous().view(4, 4)
print(M)
> tensor([[ 0.4257,  0.7940,  0.3243, -1.3812],
          [ 0.7940, -1.2986, -1.3812, -1.0442],
          [ 0.3243, -1.3812, -0.3122,  1.2312],
          [-1.3812, -1.0442,  1.2312,  0.9811]])