tfr.utils.sorted_ranks
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 Tensor s as the ranks.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-08-18 UTC.
[null,null,["Last updated 2023-08-18 UTC."],[],[]]