You can achieve this with a for loop:
>>> sum(a==i for i in vals).bool()
tensor([[ True, True, False],
[ True, True, False]])
You can achieve this with a for loop:
>>> sum(a==i for i in vals).bool()
tensor([[ True, True, False],
[ True, True, False]])