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 runs, 10000 loops each)
vs.
2.86 ms ± 31.8 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)