Skip to content

Conversation

@zhwesky2010
Copy link
Contributor

@zhwesky2010 zhwesky2010 commented Aug 11, 2021

PR types

Bug fixes

PR changes

Others

Describe

手动设置的梯度是to_tensor出来的,to_tensor默认的stop_gradient为true,导致反向var的stop_gradient变成了true,而前向var为false,因此前向var认为可以创建反向OP,而反向var又在SetOutput时把自己从输出里剪掉了,这导致了后面到inplace时执行报错。

该PR修改了手动设置梯度的逻辑,修复了这个问题 。

@paddle-bot-old
Copy link

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

Copy link
Contributor

@MingMingShangTian MingMingShangTian left a comment

Choose a reason for hiding this comment

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

LGTM

@zhwesky2010 zhwesky2010 merged commit dffb0b2 into PaddlePaddle:develop Aug 12, 2021
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