Solved by ptrblck in post #4 
              
              
                Oh sorry, I apparently missed the most important part of the question. 
I’m not sure, if there is a function for this, but this code snippet should work: 
x = [torch.tensor([0, 1, 2, 3, 4]), torch.tensor([0, 1, 2])]
max_len = max([t.size(0) for t in x])
res = [torch.cat((t, t[:max_len-t.size(0)])) f…