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

replace append_op with C_ops for assign op #41118

Merged
merged 5 commits into from
Apr 1, 2022

Conversation

pangyoki
Copy link
Contributor

@pangyoki pangyoki commented Mar 29, 2022

PR types

Others

PR changes

Others

Describe

使用append_op调用assign时,inplace_version会有问题。所以动态图模式下改为_C_ops调用形式。

assign时,输出的tensor可能本来就有值,此时需要将输出的tensor传入到assign op中。

  • 因此需要修改自动代码生成时assign的行为:将assign输出添加到op_passing_outs_map中。
  • python API也相应需要修改,如果输出为None,需要在python端预先生成输出tensor,再传入assign中。

Copy link
Contributor

@wanghuancoder wanghuancoder left a comment

Choose a reason for hiding this comment

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

LGTM

@pangyoki pangyoki merged commit c86e3a1 into PaddlePaddle:develop Apr 1, 2022
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.

2 participants