Find idx between two unique values tensors

Hi. As shown in the minimal example below, I would like to know how to find the index between two tensors of Bx3xN. Just like a[idx] == b.

I tried to use the method under that problem, but it suggests excessive memory requirements. Because I have a large N value, close to 50k