tensor.unfold should work:
x = torch.arange(0,32*400).reshape(1,32,400)
cat = []
shift = 4
ndivides = 99
for i in range(ndivides):
    cat.append(x[:,:, i*shift:(i+1)*shift +(shift //2)*2])
results = torch.stack(cat,dim=1)


tmp = x.unfold(2, 8, 4).permute(0, 2, 1, 3)
print((tmp == results).all())
> tensor(True)