-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add Sparse op sparse_relu #40959
Add Sparse op sparse_relu #40959
Conversation
✅ This PR's description meets the template requirements! |
你的PR提交成功,感谢你对开源项目的贡献! |
SparseCooTensor* out); | ||
|
||
template <typename T, typename Context> | ||
SparseCooTensor SparseRelu(const Context& dev_ctx, const SparseCooTensor& x) { |
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.
在 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.
是的,这里不能直接在前端通过SparseCooTensor的values熟悉来调用dense的relu的原因主要是:1. SparseCooTensor是在后端进行封装的,2. 动态图的autograd属性在API Tensor中,不在后端的DenseTensor里。
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 for CMakeList.txt
See the License for the specific language governing permissions and | ||
limitations under the License. */ | ||
|
||
#include "paddle/phi/kernels/sparse/sparse_activation_grad_kernel.h" |
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.
这个文件命名是不是有点冗余,sparse目录下,还需要sparse_的前缀吗
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.
好的,我下一个PR里进行优化。
PR types
New features
PR changes
OPs
Describe
sparse_kernel
改成sparse