PyTorch .sort Behavior Changes from Version 2.0.1 to 2.1.0

Background In this notebook I’m going to explore how (and hopefully why) you can start with different codes.indices but end up with the same ivf and ivf_lengths when indexing a document collection using colbert-ai . I came across this behavior by accident. I was comparing final and intermediate colbert-ai index artifacts between installs using torch==2.0.1 and torch==2.1.0 and found that even…