Pytorch merging list of tensors together
Let's say I have a list of tensors ([A , B , C ] where each tensor of is of shape [batch_size X 1024]. 
I want to merge all the tensors into a single tensor in the following way : 
The first row in A is the first row in the new tensor, and the first row of B is the seocnd row in the new tensor, and the first row of C is the third row of the new tensor and so on and so forth. 
So far I did it with for loops and this is not effictive at all.
Would love to hear about more efficent ways.

Thanks

Here's a minimal example that works:

import torch
a = torch.tensor([[1,1],[1,1]])
b = torch.tensor([[2,2],[2,2]])
c = torch.tensor([[3,3],[3,3]])
torch.stack([a,b,c],dim=0).view(6,2).t().contiguous().view(6,2)


The output is:

tensor([[1, 1],
        [2, 2],
        [3, 3],
        [1, 1],
        [2, 2],
        [3, 3]])


In your case, view(6,2) should change to batch_size*3, 1024.

Solution adapted from PyTorch forums
 where an example was shown with two tensors.
