提交 edd3ee67 编写于 作者: M Megvii Engine Team

fix(mgb): add error infomation for old version load new elemwise mode

GitOrigin-RevId: d425425d2f7137db3dd3ea5ddc49866d04ea75f8
上级 a7e28ebe
......@@ -141,7 +141,10 @@ const ModeTrait& ModeTrait::from_mode(Mode mode) {
#pragma message "elemwise mode stripped"
#endif
}
megdnn_assert(
static_cast<std::size_t>(mode) < traits.size(),
"Invalid elemwise mode in this version. "
"Maybe this version is too old, and you may need to update.");
auto&& ret = traits.at(static_cast<int>(mode));
#if !MEGDNN_ELEMWISE_MODE_ENABLE_ALL
megdnn_assert(ret.arity);
......
......@@ -274,7 +274,10 @@ const ModeTrait& ModeTrait::from_mode(Mode mode) {
SET(init_bool_unary_op, ISINF);
#undef SET
}
megdnn_assert(
static_cast<std::size_t>(mode) < traits.size(),
"Invalid elemwise multitype mode in this version. "
"Maybe this version is too old, and you may need to update.");
return traits.at(static_cast<int>(mode));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册