Fast, differentiable sorting and ranking without custom C++ or CUDA extensions. This is a lightweight implementation of Fast Differentiable Sorting and Ranking (Blondel et al.) based on fast-soft-sort and inspired by torchsort. Unlike torchsort, this version requires no custom C++ or CUDA extensions, making it easy to install and portable across platforms. While optimized C++/CUDA implementations may have a performance advantage for extremely large sequence lengths, this version is optimized for typical deep learning workflows. Try it here:
Installation
pip install torchpsort
[!NOTE] The CPU forward implementation uses Numba for JIT compilation like fast-soft-sort. Numba is installed automatically as a dependency of
torchpsort. On CUDA tensors, the forward pass uses a separate chunked GPU implementation instead.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file torchpsort-0.1.8.tar.gz.
File metadata
- Download URL: torchpsort-0.1.8.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
871feee6ed9ae7ddc2b9b1d77bb0ffee7c54b11b1ab024578113db879c4f81e3
|
|
| MD5 |
509faca0ca6ede2954e538b451a37777
|
|
| BLAKE2b-256 |
fdcaea5c8d594c660db65136d1c9bd0aeff87c7b75c55da648a11a5d7f3f2980
|
File details
Details for the file torchpsort-0.1.8-py3-none-any.whl.
File metadata
- Download URL: torchpsort-0.1.8-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
284695aba8d21879f11bf32e2e47c28f872ebe754e783eda24359b8af0f77455
|
|
| MD5 |
6d593095c07b9207cb3ca71866a2cabc
|
|
| BLAKE2b-256 |
a57a57f2fd06868ed05d69bf0fa590f5792dbb3c972d10a657254fa9725c69e4
|