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

make paddle.to_tensor() copy if data is tensor #33335

Merged

Conversation

zhiqiu
Copy link
Contributor

@zhiqiu zhiqiu commented Jun 3, 2021

PR types

Bug fixes

PR changes

APIs

Describe

  • make paddle.to_tensor() copy if data is varbase, so the computation graph is splited from which of data.
  • make the stop_gradient of input(data) not changed

@paddle-bot-old
Copy link

paddle-bot-old bot commented Jun 3, 2021

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

zhwesky2010
zhwesky2010 previously approved these changes Jun 4, 2021
Copy link
Contributor

@zhwesky2010 zhwesky2010 left a comment

Choose a reason for hiding this comment

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

LGTM,as_tensor会尽量做一些不拷贝的操作,目前没有应用场景,因此无需将其特性合并到to_tensor中,to_tensor始终保持拷贝

Copy link
Contributor

@zhwesky2010 zhwesky2010 left a comment

Choose a reason for hiding this comment

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

中文文档需改下

Copy link
Contributor

@TCChenlong TCChenlong 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

@jzhang533 jzhang533 left a comment

Choose a reason for hiding this comment

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

lgtm

@zhiqiu zhiqiu merged commit 6877b13 into PaddlePaddle:develop Jun 4, 2021
@zhiqiu zhiqiu changed the title make paddle.to_tensor() copy if data is varbase make paddle.to_tensor() copy if data is tensor Oct 14, 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.

4 participants