mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-02 23:39:58 +00:00
[EP Perf] Fix sort (#18174)
### Description Existing sort can't handle the index within test data folders/inputs name string correctly, when index is larger than 10 Update the logic to sort based on index fetched by regex
This commit is contained in:
parent
dabd395fdf
commit
f9d5705db4
1 changed files with 7 additions and 1 deletions
|
|
@ -89,7 +89,13 @@ TRT_ENGINE_CACHE_DIR_NAME = "engine_cache"
|
|||
|
||||
def split_and_sort_output(string_list):
|
||||
string_list = string_list.split("\n")
|
||||
string_list.sort()
|
||||
|
||||
def custom_sort(item):
|
||||
# Parse digits
|
||||
numbers = re.findall(r"\d+", item)
|
||||
return int(numbers[0]) if numbers else float("inf")
|
||||
|
||||
string_list.sort(key=custom_sort)
|
||||
return string_list
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue