提交 c80fbaaf 编写于 作者: T tensor-tang 提交者: GitHub

refine the attr assert (#1947)

test=develop
上级 4f332056
......@@ -157,16 +157,8 @@ struct PMNode {
template <typename T>
PMNode* assert_op_attr(const std::string& attr_name, const T& attr) {
asserts_.push_back([=](const Node* x) {
if (x && x->IsStmt()) {
auto* op_info = x->stmt()->op_info();
bool cond = (op_info->HasAttr(attr_name) &&
op_info->GetAttr<T>(attr_name) == attr);
return cond;
}
return false;
});
return this;
return assert_op_attr_satisfied<T>(
attr_name, [=](const T& src) { return src == attr; });
}
private:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册