For example, here is a example, input are a and b, output is result.
a = torch.tensor([[1, 2, 3, 4],
[2, 3, 4, 5]])
b = torch.tensor([[3, 4, 5, 6],
[4, 5, 6, 7]])
result = torch.tensor([[1, 2, 3, 4],
[3, 4, 5, 6],
[2, 3, 4, 5],
[4, 5, 6, 7]])