for example,
>>> a = torch.tensor([4, 1, 4, 3, 2, 3], dtype=torch.long)
>>> b,c =torch.unique(a,return_inverse=True)
>>> a
tensor([4, 1, 4, 3, 2, 3])
>>> b
tensor([1, 2, 3, 4])
>>> c
tensor([3, 0, 3, 2, 1, 2])
I want to get the index of each value of b
in a
i.e., d
such that a[d]=b
>>> d=torch.tensor([1,4,3,0])
>>> a[d]
tensor([1, 2, 3, 4])