Hi!
I have a following piece of code:
sorted_values, indices = torch.sort(score, dim=0, descending=True)

score[filt_idxs] = float("-inf")
filt_values, filt_indices = torch.sort(score, dim=0, descending=True)

I have manually examined score tensor and it only has a single -inf value after filtering. That would mean that filt_indices might shift by at most one up compared to indices.
However, I see that in the cases where values of score tensor are the same, indices and filt_indices are completely different.
That behavior gets me thinking that sorting in PyTorch is non-deterministic. Is that so? If yes - how can I make it deterministic?
Extra details:

All the operations are on CPU
PyTorch 1.1.0