The torch.unique() function returns the unique values and the inverse indices,  but unlike np.unique, doesn’t return the indices of the first occurrence of these unique values. Is there any way of doing this in pytorch without using a for loop for each unique value?