-
Notifications
You must be signed in to change notification settings - Fork 764
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
Conversation
感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-5984.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html |
中英文 PR 之间要互链 |
y, = ctx.saved_tensor() | ||
grad = dy * (1 - paddle.square(y)) | ||
return grad | ||
COPY-FROM: paddle.autograd.py_layer.PyLayerContext |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
奇了个怪怪,怎么这也 COPY 不过来?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data.stop_gradient = False | ||
# run custom Layer. | ||
z = cus_tanh.apply(data, func1=paddle.tanh) | ||
COPY-FROM: paddle.autograd.PyLayer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这边copy from的应该是apply方法吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个api是不是被删了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wanghuancoder 辛苦确认pylayer的apply方法,是否在源码中被删除
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apply这个API是没有被删的,他是PyLayer最基础的入口。是现在C++里面。所以在英文源代码中没找到文档。但是在多个示例代码里都有使用到。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那写在paddle.autograd.PyLayer
这里应该也没啥问题吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的那应该没问题
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的那应该没问题
修改COPY-FROM No. 3 autograd
PADDLEPADDLE_PR=54921
相关链接:
#5957