Skip to content
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

Merged
merged 1 commit into from
May 21, 2021
Merged

Conversation

winter-wang
Copy link
Contributor

PR types

New features

PR changes

Others

Describe

添加了pass强准入定义

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.


InputOrOutputCompat& InputOrOutputCompat::IsTensorList() {
conditions_.emplace_back([](const std::vector<std::string>& input) -> bool {
return input.size() > 1u;
Copy link
Contributor

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;
Copy link
Contributor

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()) {
Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

>=

Copy link
Contributor

@Superjomn Superjomn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Superjomn Superjomn merged commit 79ed717 into PaddlePaddle:develop May 21, 2021
@winter-wang winter-wang changed the title add method for enhance pass,test=develop add method for enhance pass. Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants