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

Fix set_value failure when source tensor is fp16 Dtype #46801

Merged
merged 7 commits into from
Oct 11, 2022

Conversation

Courtesy-Xs
Copy link
Contributor

PR types

Bug fixes

PR changes

OPs

Describe

Fix set_value failure when source tensor is fp16 Dtype and destiny value is a number

@paddle-bot
Copy link

paddle-bot bot commented Oct 9, 2022

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

@Xreki Xreki left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -724,6 +724,19 @@ KernelSignature SetValueOpArgumentMapping(const ArgumentMappingContext& ctx) {
"shape",
"bool_values"},
{"Out"});
} else if (ctx.HasAttr("fp16_values")) {
// NOTE(LiuYang):Here any_cast doesn't support fp16 values.
Copy link
Contributor

Choose a reason for hiding this comment

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

fp16_values是用std::vector<float>存的,所以这里应该是any_cast<std::vector<float>>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done,Thanks

@Xreki Xreki merged commit 2341ed5 into PaddlePaddle:develop Oct 11, 2022
lanxianghit pushed a commit that referenced this pull request Oct 13, 2022
Fix set_value failure when source tensor is fp16 Dtype and destiny value is a number
(dev PR link:#46801)
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.

4 participants