Skip to content

Add docs torch.Tensor.requires_grad #7374

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Xuxuanang
Copy link
Contributor

torch.Tensor.requires_grad

Copy link

paddle-bot bot commented Aug 4, 2025

感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-7374.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html
预览工具的更多说明,请参考:飞桨文档预览工具

Paddle 无此 API,需要组合实现。

### 转写示例
#### requires_grad:是否计算梯度
Copy link
Collaborator

@zhwesky2010 zhwesky2010 Aug 14, 2025

Choose a reason for hiding this comment

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

这个API没有参数,这里就不写

下面只给给了 左值的用法,右值的示例也给下

### torch 写法
x.requires_grad

### paddle 写法
not x.stop_gradient

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants