-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[static code gen]add error msg in composite maker code gen #51211
[static code gen]add error msg in composite maker code gen #51211
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
❌ The PR is not created using PR's template. You can refer to this Demo. |
… fix_static_code_gen
… fix_static_code_gen
… fix_static_code_gen
@@ -691,6 +692,29 @@ class {{op_name | to_composite_grad_opmaker_name}} : public prim::CompositeGradO | |||
{%- endfor %} | |||
{%- endmacro %} | |||
|
|||
construct_composite_tensor_attr(attrs, fluid_attrs, attr_dict) |
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.
已经删除
{% for i in range(attrs_length) %} | ||
{% if "tensor_name" in attr_dict[attrs[i]] %} | ||
auto {{'tensor_' + attrs[i]}} = this->GetOptionalSingleForwardInput("{{attr_dict[attrs[i]]['tensor_name']}}"); | ||
if ({{'tensor_' + attrs[i]}}.is_initialized()) { |
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.
能否直接使用if进行判断,is_initialized
和tensor成员函数名相同了,使用auto类型时容易引起误导
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.
done
PADDLE_THROW(platform::errors::Unimplemented( | ||
"We don't support dynamic tensor attribute for {{op_name}} composite" | ||
"for now. ")); |
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.
异常信息中建议包含attrbitue name信息
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.
done
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
Pcard-66975
由于组合算子不支持
Tensor attribute
,因此在composite grad maker
中为组合算子使用到Tensor attribute
添加报错.