Hi, you’re welcome.
The code is actually same, because for first answer, I considered your tensor as a batch of tensor which only have ONE tensor by using squeeeze(0). So still same code will works:
a.unsqueeze(0).unfold(2, 2, 2)[0].unfold(2, 2, 2).contiguous().view(2, 6, 2, 2)

If I want to explain it in precise manner, extracting patches is all about playing with number of unfold() you consecutively use and the arguments of it which are dim, size and stride. The most important one is dim because it extract patches regarding that dimension.
PS.: I just changed first arg of view from 1 to 2.
best regards
Nik