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 assign composite backward op #51430

Merged
merged 7 commits into from
Mar 15, 2023

Conversation

SylarTiaNII
Copy link
Contributor

@SylarTiaNII SylarTiaNII commented Mar 9, 2023

PR types

New features

PR changes

Others

Describe

add assign composite backward op
not supporting bfloat16 tests since original op neither supports.

@paddle-bot
Copy link

paddle-bot bot commented Mar 9, 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.

Copy link
Contributor

@xiaoguoguo626807 xiaoguoguo626807 left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -41,14 +43,16 @@ def test_forward(self):

def test_backward(self):
paddle.enable_static()
self.check_grad(['X'], 'Out', check_eager=True)
self.check_grad(['X'], 'Out', check_eager=True, check_prim=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

pr标注下原算子缺少bfloat16单测,所以组合算子也没有进行测试

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Charles-hit
Charles-hit previously approved these changes Mar 14, 2023
template <typename T>
void assign_grad(const Tensor& out_grad, Tensor* x_grad) {
if (x_grad) {
auto res = assign<T>(out_grad);
Copy link
Contributor

Choose a reason for hiding this comment

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

it's can use by_pass like subtract_grad

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@SylarTiaNII SylarTiaNII reopened this Mar 15, 2023
@xiaoguoguo626807 xiaoguoguo626807 merged commit 297182f into PaddlePaddle:develop Mar 15, 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.

3 participants