@Tim5 there ware different ways of solving a problem
a=[torch.rand(1,10), torch.rand(1,10), torch.rand(1,10)]
print(torch.cat(a, axis=0).size())
print(torch.cat(a, axis=1).size())
print(torch.stack(a).size())

torch.Size([3, 10])
torch.Size([1, 30])
torch.Size([3, 1, 10])


Generally if you use stack in a loop then it can give problems