Hi everyone!
I’m trying to compare all row-elements of 2 2D tensors. An easy example of would be the following two tensors
a = torch.tensor([[1,2], [4,5], [7,8]])
b = torch.tensor([[2,3], [7,5], [-1,7]])

Now I’d like to check for each element in the first tensor if it is part of the same row in the second tensor. My expected result would be
[
[False, False] (1 vs [2, 3])
[True, False] ((2 vs [2, 3)
[False, False] (4 vs  [7,5])
[False, True] (5 vs  [7,5])
[False, True] (7 vs  [-1,7])
[False, False] (8 vs  [-1,7])
]

Does anyone have any idea how to solve this efficiently?
Thanks a lot!