Hi,
I’m afraid the joint use of unbind, your stripe function and stack makes it so that some storage offset becomes negative.
Why not use a batch stripe version instead (that should be much faster as well) ?
def batch_stripe(a):
    b, i, j = a.size()
    assert i >= j
    b_s, k, l = a.stride()
    return torch.as_strided(a, (b, i - j, j), (b_s, k, k+1))