diff --git a/include/tvm/runtime/container/array.h b/include/tvm/runtime/container/array.h index 11bacb18e92c..1b735e73c386 100644 --- a/include/tvm/runtime/container/array.h +++ b/include/tvm/runtime/container/array.h @@ -325,6 +325,8 @@ class Array : public ObjectRef { */ template Array(IterType first, IterType last) { + static_assert(is_valid_iterator_v, + "IterType cannot be inserted into a tvm::Array"); Assign(first, last); } @@ -481,6 +483,9 @@ class Array : public ObjectRef { */ template void insert(iterator position, IterType first, IterType last) { + static_assert(is_valid_iterator_v, + "IterType cannot be inserted into a tvm::Array"); + if (first == last) { return; } diff --git a/src/te/schedule/schedule_lang.cc b/src/te/schedule/schedule_lang.cc index 0fcd6133c4a2..e8f4f65eb651 100644 --- a/src/te/schedule/schedule_lang.cc +++ b/src/te/schedule/schedule_lang.cc @@ -200,7 +200,7 @@ Stage& Stage::env_threads(Array threads) { ICHECK_EQ(self->env_threads.size(), 0U) << "Already set env_threads"; Array& leaf_vars = self->leaf_iter_vars; Array& all_vars = self->all_iter_vars; - std::vector temp; + std::vector temp; for (IterVar iv : threads) { temp.push_back(iv); }