From 0ebe8e34f801f71d6cca126e929b453fc903eb8f Mon Sep 17 00:00:00 2001 From: Yuriy Chernyshov Date: Fri, 3 Mar 2023 03:38:33 +0400 Subject: [PATCH] Do not use ADL to invoke std algos (#14851) This is a follow up for #14716 --- onnxruntime/core/providers/cpu/math/top_k.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onnxruntime/core/providers/cpu/math/top_k.cc b/onnxruntime/core/providers/cpu/math/top_k.cc index b781cea9c3..c9463e3190 100644 --- a/onnxruntime/core/providers/cpu/math/top_k.cc +++ b/onnxruntime/core/providers/cpu/math/top_k.cc @@ -130,7 +130,7 @@ static void SelectTopK(const Comparator& comparer, // find the top k (largest or smallest) elements in the data holder - O(n) average. O(n*n) worst case. // See https://en.wikipedia.org/wiki/Quickselect - nth_element(data_holder.begin(), data_holder.begin() + (k - 1), data_holder.end(), comparer); + std::nth_element(data_holder.begin(), data_holder.begin() + (k - 1), data_holder.end(), comparer); // sort the top k elements if needed - O (k log k) if (sort_top_k) {