Look at the source code. It already has a tensorflow implementation of fast_sort_soft. GitHub - google-research/fast-soft-sort: Fast Differentiable Sorting and Ranking
Look at the source code. It already has a tensorflow implementation of fast_sort_soft. GitHub - google-research/fast-soft-sort: Fast Differentiable Sorting and Ranking