Currently I use the following function do it. I would like to know whether there is any builtin function does it, so that I can avoid the for loop used here.
tf.stack([ Inf[ i:i+ width] for i in range(length-width+1)])