PyTorch doesn’t have the same isin implementation, but you might take a look at the numpy implementation 9 and maybe use their method?
Alternatively, you could of course use a list comprehension as:
x = torch.arange(7)
y = torch.tensor([4, 5, 6])

ret = torch.stack([y_ == x for y_ in y]).sum(0).bool()