Hi,
I do not know there is any builtin function for this, but the best way I can think of to loop over elements in b and use it as index in a.
I know this solution sounds weird but may be we can optimize it later!
indices = [torch.sum(a==b[idx], dim=1) == len(b[idx]) for idx in range(len(b))]

a==b[idx] will return [x, x, x] in your shape where x is boolean. We looking for equality so sum should be equal to length of index tensor b.
Bests