Hi,
If you do this on Tensors that require gradients, the autograd state might take quite a bit of memory as all the intermediary result might be saved (you go from linear to quadratic).
Also why do you concatenate inside the loop? Why not just append to the list inside the loop and concatenate once at the very end?