Hey guys
Having such a goal and a solution
a = torch.tensor([[1,2], [3,4]])
b = torch.tensor([[5,6,7], [8,9,10]])
unwind_a = a.repeat_interleave(b.shape[1], dim=0)
unwind_b = b.reshape(-1, 1)
torch.cat([unwind_a, unwind_b], dim=1)
>>tensor([[ 1, 2, 5],
[ 1, 2, 6],
[ 1, 2, 7],
[ 3, 4, 8],
[ 3, 4, 9],
[ 3, 4, 10]])
So is there any single specific tensor operation instead of such transformation pipeline. Something like combine or join maybe?
Thank you.