Commit 867ad378 by Yizhi Liu Committed by Tianqi Chen

check attach_stage & group in schedule.copy() (#139)

parent 52ad69fc
......@@ -390,17 +390,25 @@ Schedule Schedule::copy() const {
}
for (Stage s : n->stages) {
if (s->attach_stage.defined()) {
CHECK(smap.find(s->attach_stage) != smap.end())
<< s->attach_stage << " not found in " << (*this);
s->attach_stage = smap.at(s->attach_stage);
}
if (s->group.defined()) {
CHECK(smap.find(s->group) != smap.end())
<< s->group << " not found in " << (*this);
s->group = smap.at(s->group);
}
}
for (Stage s : n->groups) {
if (s->attach_stage.defined()) {
CHECK(smap.find(s->attach_stage) != smap.end())
<< s->attach_stage << " not found in " << (*this);
s->attach_stage = smap.at(s->attach_stage);
}
if (s->group.defined()) {
CHECK(smap.find(s->group) != smap.end())
<< s->group << " not found in " << (*this);
s->group = smap.at(s->group);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment