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

修改COPY-FROM No. 3 autograd #5984

Merged
merged 3 commits into from
Jul 6, 2023

Conversation

gouzil
Copy link
Member

@gouzil gouzil commented Jun 27, 2023

修改COPY-FROM No. 3 autograd

PADDLEPADDLE_PR=54921

相关链接:
#5957

@paddle-bot
Copy link

paddle-bot bot commented Jun 27, 2023

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

@gouzil
Copy link
Member Author

gouzil commented Jun 27, 2023

@sunzhongkai588

@SigureMo
Copy link
Member

中英文 PR 之间要互链

y, = ctx.saved_tensor()
grad = dy * (1 - paddle.square(y))
return grad
COPY-FROM: paddle.autograd.py_layer.PyLayerContext
Copy link
Member

Choose a reason for hiding this comment

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

image

挂了呢,应该用暴露的 API paddle.autograd.PyLayerContext

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Copy link
Member

Choose a reason for hiding this comment

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

奇了个怪怪,怎么这也 COPY 不过来?

Copy link
Member Author

Choose a reason for hiding this comment

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

v2-e8e14795cbdb002a023c316c6698092c_720w

data.stop_gradient = False
# run custom Layer.
z = cus_tanh.apply(data, func1=paddle.tanh)
COPY-FROM: paddle.autograd.PyLayer
Copy link
Collaborator

Choose a reason for hiding this comment

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

这边copy from的应该是apply方法吧

Copy link
Member Author

Choose a reason for hiding this comment

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

这个api是不是被删了

Copy link
Collaborator

Choose a reason for hiding this comment

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

@wanghuancoder 辛苦确认pylayer的apply方法,是否在源码中被删除

Copy link
Contributor

Choose a reason for hiding this comment

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

apply这个API是没有被删的,他是PyLayer最基础的入口。是现在C++里面。所以在英文源代码中没找到文档。但是在多个示例代码里都有使用到。

Copy link
Member Author

Choose a reason for hiding this comment

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

那写在paddle.autograd.PyLayer这里应该也没啥问题吧

Copy link
Collaborator

Choose a reason for hiding this comment

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

好的那应该没问题

Copy link
Collaborator

@sunzhongkai588 sunzhongkai588 left a comment

Choose a reason for hiding this comment

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

LGTM

data.stop_gradient = False
# run custom Layer.
z = cus_tanh.apply(data, func1=paddle.tanh)
COPY-FROM: paddle.autograd.PyLayer
Copy link
Collaborator

Choose a reason for hiding this comment

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

好的那应该没问题

@luotao1 luotao1 merged commit 3354d86 into PaddlePaddle:develop Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants