Hi @whoab,
most likely, there is a better solution somewhere out there, but it should do the job:
torch.unique((a == torch.Tensor([1, 2, 3])).nonzero()[:, 0])

I hope I could help you.
Regards,
Unity05