Hi,
I have tested your cases and it seems you are right.
Clearly, docs say that if one specifies dim then whether sorted=True or sorted=False the tensor will be sorted even though default values is None. And I think because of that, even though the default value of sorted=False it stills sorts the tensor.
Due to this forced sorting, I think it losses the original order of values.
This is another related post around this issue:

  
    
    
    Is it a bug for torch.unique on gpu? 
  
  
    Stumbled upon this now as well. If there is different behaviour, maybe include a warning or similar? I am often changing between gpu and cpu, and this error would not have been expected. 
Also, for my case (5x5 tensors), it was significantly faster to transform to cpu and do the sort there and  back again. 
def unique_via_cpu(x, device):
    return torch.unique(x.cpu(), sorted=False).to(device)

Compared to the function posted above by @ptrblck: 
118 µs ± 1.05 µs per loop (mean ± std. dev. of 7 …
  


Also, in the referenced post, you can find an approach to get the correct order but it is not built-in.
Bests