-
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 share external data interface #39809
add share external data interface #39809
Conversation
Thanks for your contribution! |
b0b1bfc
to
ea660ee
Compare
@@ -405,4 +406,69 @@ TEST(Predictor, Run) { | |||
predictor->TryShrinkMemory(); | |||
} | |||
|
|||
TEST(Tensor, CpuShareExternalData) { |
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.
单测中加一下输出share external的case吧
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
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 for const_cast
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
APIs
Describe
add share_external_data interface demo Paddle-Inference-Demo#219
接口功能:直接使用用户的数据指针创建输入 Tensor(CopyFromCpu接口会将数据拷贝一份,新接口没有数据拷贝的过程)
注意事项:用户的数据指针在推理结束前不能改动