In [5]:
ro, li, bi, bo, li, ro = [], [], [], [], [], []

In [8]:
o = list()
o


Out[8]:
[]

In [39]:
from random import shuffle
import torch
a = list(range(10))
b = list(range(10))
c = list(range(10))
d = zip(a, b, c)
shuffle(d)
a,b,c = zip(*d)
at = torch.Tensor(a).unsqueeze(0).t()
bt = torch.Tensor(a).unsqueeze(0).t() 
ct = torch.cat((at, bt), 1)
for i in range(10):
    if i+2 < 10:
        bt[i]= bt[i+2]
# print at[:8], bt[:8]
ctp = ct[torch.randperm(10)]
print a[0, b, c


(3, 6, 7, 8, 9, 1, 2, 4, 5, 0) (3, 6, 7, 8, 9, 1, 2, 4, 5, 0) (3, 6, 7, 8, 9, 1, 2, 4, 5, 0)

In [13]:
help(torch.stack)


Help on function stack in module torch.functional:

stack(sequence, dim=0, out=None)
    Concatenates sequence of tensors along a new dimension.
    
    All tensors need to be of the same size.
    
    Arguments:
        sequence (Sequence): sequence of tensors to concatenate.
        dim (int): dimension to insert. Has to be between 0 and the number
            of dimensions of concatenated tensors (inclusive).


In [ ]: