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 share external data interface #39809

Merged

Conversation

JZZ-NOTE
Copy link
Contributor

@JZZ-NOTE JZZ-NOTE commented Feb 22, 2022

PR types

New features

PR changes

APIs

Describe

  1. 接口说明及使用 demo pr:
    add share_external_data interface demo Paddle-Inference-Demo#219
  2. 添加 ShareExternalData 接口
    接口功能:直接使用用户的数据指针创建输入 Tensor(CopyFromCpu接口会将数据拷贝一份,新接口没有数据拷贝的过程)
    注意事项:用户的数据指针在推理结束前不能改动

@paddle-bot-old
Copy link

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

@JZZ-NOTE JZZ-NOTE force-pushed the add_share_external_data_interface branch from b0b1bfc to ea660ee Compare February 23, 2022 07:20
@@ -405,4 +406,69 @@ TEST(Predictor, Run) {
predictor->TryShrinkMemory();
}

TEST(Tensor, CpuShareExternalData) {
Copy link
Contributor

Choose a reason for hiding this comment

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

单测中加一下输出share external的case吧

jiweibo
jiweibo previously approved these changes Feb 23, 2022
Copy link
Contributor

@jiweibo jiweibo left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@zhiqiu zhiqiu left a 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

Copy link
Contributor

@jiweibo jiweibo 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 1ff1c1e into PaddlePaddle:develop Mar 2, 2022
@JZZ-NOTE JZZ-NOTE deleted the add_share_external_data_interface branch March 17, 2022 09:27
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