How to get the indicies to make a Tensor unique?

The goal is to get the ids that x[ids] is equivalent to x.unique()