tfr.utils.sorted_ranks
Stay organized with collections
Save and categorize content based on your preferences.
Returns an int Tensor as the ranks (1-based) after sorting scores.
tfr.utils.sorted_ranks(
scores, shuffle_ties=True, seed=None
)
Example: Given scores = [[1.0, 3.5, 2.1]], the returned ranks will be [[3, 1,
2]]. It means that scores 1.0 will be ranked at position 3, 3.5 will be ranked
at position 1, and 2.1 will be ranked at position 2.
Args |
scores
|
A Tensor of shape [batch_size, list_size] representing the
per-example scores.
|
shuffle_ties
|
See sort_by_scores.
|
seed
|
See sort_by_scores.
|
Returns |
A 1-based int Tensors as the ranks.
|
[null,null,["Last updated 2023-08-18 UTC."],[],[]]