You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by ju...@apache.org on 2023/02/08 00:05:26 UTC
[tvm] 01/01: [MetaSchedule] Fix a typo in MemoryDatabase
This is an automated email from the ASF dual-hosted git repository.
junrushao pushed a commit to branch junrushao-patch-1
in repository https://gitbox.apache.org/repos/asf/tvm.git
commit 7b52b4a8d5e379ae34141d28cdb45d2be1054328
Author: Junru Shao <ju...@apache.org>
AuthorDate: Tue Feb 7 16:05:18 2023 -0800
[MetaSchedule] Fix a typo in MemoryDatabase
This typo was introduced a while ago, but was not uncovered until I was rebasing Relax when a unittest crashes.
---
src/meta_schedule/database/memory_database.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/meta_schedule/database/memory_database.cc b/src/meta_schedule/database/memory_database.cc
index 8cbde46f83..533a86acac 100644
--- a/src/meta_schedule/database/memory_database.cc
+++ b/src/meta_schedule/database/memory_database.cc
@@ -85,7 +85,7 @@ class MemoryDatabaseNode : public DatabaseNode {
}
std::stable_sort(results.begin(), results.end(), SortTuningRecordByMeanRunSecs());
if (results.size() > static_cast<size_t>(top_k)) {
- return {results.begin(), results.end() + top_k};
+ return {results.begin(), results.begin() + top_k};
} else {
if (results.size() < static_cast<size_t>(top_k)) {
LOG(WARNING) << "The size of the GetTopK result is smaller than requested. There are not "