mirror of
https://github.com/NVIDIA/nvbench.git
synced 2026-07-03 05:37:49 +00:00
make Python percentile_rank align C++ implementation
round in Python returns nearest even, while in C++ it behaves as x -> floor(x + 0.5)
This commit is contained in:
@@ -1322,7 +1322,8 @@ def compute_timing_interval_from_samples(samples):
|
||||
|
||||
def percentile_rank(percentile: int, sample_count: int) -> int:
|
||||
clamped_percentile = min(max(percentile, 0), 100)
|
||||
return round((clamped_percentile / 100.0) * (sample_count - 1))
|
||||
rank = (clamped_percentile / 100.0) * (sample_count - 1)
|
||||
return math.floor(rank + 0.5)
|
||||
|
||||
|
||||
def compute_robust_timing_input_from_samples(samples):
|
||||
|
||||
Reference in New Issue
Block a user