Thank you.
I was trying to generalize my question. I’m not creating a new tensor in the forward and i don’t intend to iterate through my batch.
My problem is, how do I accumulate tensors in a new tensor. I don’t want to use mlist = [] and .append which I assume run on the CPU. That basically means moving my data from the GPU to the CPU, accumulate and moving them back. Is there a way to directly accumulate tensors in another tensor.
This usually happens in a loop.