Dose pytorch support join
operator in SQL?
I have a tensor a
and a tensor b
, I want to join
the first row of a
and the second row of b
to get c
, based on the second row of a
and the first row of b
.
Dose any function support it? Or how can I achieve it with short time and small memory?
a = torch.tensor([[11, 1],
[12, 1],
[12, 2]])
b = torch.tensor([[1, 21],
[1, 22],
[2, 23]])
c = torch.tensor([[11, 21],
[11, 22],
[12, 21],
[12, 22],
[12, 23]])
c = f(a,b)