Solved by iacob in post #3 
              
              
                You can do this with a for loop: 
>>> sum(A==i for i in B).bool()
tensor([[False,  True,  True],
        [ True, False, False]])