Hello
I am doing something like this in my code but it is very slow.
I was wondering if there is a faster way to do it.
in my example shift and ndivides  are subject to change from case to case.
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)

sometimes if I change shift or ndivides, it wont work, but that is not an issue, the main issue is that the loop is too slow, unfortunately.