-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add method for enhance pass. #33004
add method for enhance pass. #33004
Conversation
Thanks for your contribution! |
de2fbfa
to
c4f9b16
Compare
|
||
InputOrOutputCompat& InputOrOutputCompat::IsTensorList() { | ||
conditions_.emplace_back([](const std::vector<std::string>& input) -> bool { | ||
return input.size() > 1u; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个实现有问题
可以选择删了,没有办法通过 vector 来识别是否是 TensorList
const VariableNameMap& inputs_map = op_desc.Inputs(); | ||
for (auto& input_desc : inputs_map) { | ||
if (input_compats_.find(input_desc.first) == input_compats_.end()) { | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里应该判断是否为空,如果是空的也能兼容
只有意料外的Input/Output,并且有设置变量,才能直接return false
|
||
const VariableNameMap& outputs_map = op_desc.Outputs(); | ||
for (auto& output_desc : outputs_map) { | ||
if (output_compats_.find(output_desc.first) == output_compats_.end()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
AttrCompat& AttrCompat::IsNumGE(T v) { | ||
conditions_.emplace_back([v](const Attribute& attr) -> bool { | ||
T value = BOOST_GET_CONST(T, attr); | ||
return value <= v; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
>=
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
New features
PR changes
Others
Describe
添加了pass强准入定义