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

[Inference] Inference python api support fp16 #34676

Merged
merged 2 commits into from
Aug 12, 2021

Conversation

jiweibo
Copy link
Contributor

@jiweibo jiweibo commented Aug 6, 2021

PR types

Others

PR changes

Others

Describe

copy_from_cpu and copy_to_cpu support fp16.

@paddle-bot-old
Copy link

paddle-bot-old bot commented Aug 6, 2021

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

@@ -642,6 +683,7 @@ void BindZeroCopyTensor(py::module *m) {
.def("copy_from_cpu", &ZeroCopyTensorCreate<int32_t>)
.def("copy_from_cpu", &ZeroCopyTensorCreate<int64_t>)
.def("copy_from_cpu", &ZeroCopyTensorCreate<float>)
.def("copy_from_cpu", &ZeroCopyTensorCreate<paddle::platform::float16>)
Copy link
Member

Choose a reason for hiding this comment

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

建议paddle::platform::float16在paddle_infer里加个别名给用户使用,保持platform对用户不可见

Copy link
Contributor Author

Choose a reason for hiding this comment

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

可能需要把float16.h暴露出去,在C++测该type才对用户可用;目前先支持python测float16吧!

CheQiXiao
CheQiXiao previously approved these changes Aug 9, 2021
Copy link
Member

@shangzhizhou shangzhizhou left a comment

Choose a reason for hiding this comment

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

LGTM

@jiweibo jiweibo merged commit 6326c3e into PaddlePaddle:develop Aug 12, 2021
@jiweibo jiweibo deleted the in_out_fp16 branch August 12, 2021 05:21
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.

3 participants