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

[CustomOP Inplace] Automap inplace dtype and shape, support vector<Tensor> output #52114

Merged

Conversation

jiahy0825
Copy link
Contributor

@jiahy0825 jiahy0825 commented Mar 24, 2023

PR types

New features

PR changes

OPs

Describe

Pcard-66988

用户设置 SetInplaceMap 后,如果 Outputs 中的名称都在 InplaceMap 中,则不再需要显式的指定 SetInferShapeFnSetInferDtypeFn,自动对 InplaceMap 中输入输出间的 shape dtype 做映射,提升用户易用性。

本 PR 支持了 inplace vector 输入,同时支持使用 inplace 方式输出 vector,因为 SetInferShapeFnSetInferDtypeFn 中不支持输出 vector 对应的 shape 和 dtype,只能通过自动映射的方式隐式处理。

After setting SetInplaceMap, if all the names of Outputs are inside InplaceMap, users don't have to set SetInferShapeFn and SetInferDtypeFn explicitly, the framework will map the shape and data type between inputs and outputs automatically.

This PR also supports inplace vector<Tensor> input. Users have to make the use of inplace mechanism to output vector<Tensor>. we have to implicitly map inputs and outputs' shape and data type because SetInferShapeFn and SetInferDtypeFn cannot support output shape and data type of vector<Tensor>

@paddle-bot
Copy link

paddle-bot bot commented Mar 24, 2023

你的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.

@jiahy0825 jiahy0825 changed the title Custom op support vector inplace @jiahy0825 [CustomOP Inplace] Automap inplace dtype and shape, support vector<Tensor> output Mar 24, 2023
@jiahy0825 jiahy0825 changed the title @jiahy0825 [CustomOP Inplace] Automap inplace dtype and shape, support vector<Tensor> output [CustomOP Inplace] Automap inplace dtype and shape, support vector<Tensor> output Mar 24, 2023
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