Hi, I think I didn’t explain the example enough.
So the input x can be: [1, 2, 3, 4, 5, 6]
I want to locate the index of elements i in x where  i also belongs to y:[4, 5, 6]
The expected outcome  is: [False, False, False, True, True, True].
I managed to achieve this by numpy:
index = np.isin(x.numpy(), [4, 5, 6])
I am wondering if pytorch has similar functions. Thank you.