Variable-sized batches from


Supposing I have a of rank-1 tensors of varying lengths, say up to 100. I would like to create a new dataset in which each element is a 1-d stack of a varying number of consecutive elements from the first dataset, totalling less than length 200.

I know I can do this using, but is there a better way?

Thanks in advance,