Dear smth, is there anyway i can concatenate list tensors inside the loop without using stack/cat?
This the example of my case:  I want to manipulate  output, but because it is a list of tensors i want to change it to one tensor. So as the loop becomes too long the memory becomes full because the stack operation.
output = []
start=time.time()
for i in range(2):
        hx= rnn(input[:,i,:], (hx_0))
        output.append(hx)
        outs1 = torch.stack(output,1) 
         hx_0=operation(outs1)

print(output)