I want to append a new row to a tensor in each step of a loop, but neither torch.cat nor torch.stack is working for me, because they return an error. It says the tensors must have the same shape.
I can append the tensors to a list, and then stack them, but I wanted to do it in GPU, could you please suggest a way?
e.g. I have a 1x10 tensor, I want to add another 1x10 tensor so I could have 2x10 tensor. It works, but for appending another 1x10 to the 2x10 tensor, so I would have 3x10 tensor.