【Hackathon 4th No.29】为 Paddle 新增 paddle.sparse.slice 稀疏 API#53794
【Hackathon 4th No.29】为 Paddle 新增 paddle.sparse.slice 稀疏 API#53794luotao1 merged 24 commits intoPaddlePaddle:developfrom
Conversation
| 你的PR提交成功,感谢你对开源项目的贡献! |
| Sorry to inform you that 428dc2e's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
a88e97a to 74ceb80 Compare | @zkh2016 您好,目前已经修改完毕,麻烦再重新Review以下 |
| const phi::IntArray& axes_arr, | ||
| const phi::IntArray& starts_arr, | ||
| const phi::IntArray& ends_arr, |
There was a problem hiding this comment.
Why use parameter name of axes_arr, starts_arr and ends_arr? No other kernel are not named like this, just using axes, starts and ends is better?
There was a problem hiding this comment.
Thank you very much for your review!
The reason is that the data type of these parameters is IntArray, and I will get their underlying data in implementing the function, like axes_arr.GetData(). For convenience, I use axes_arr as the parameter's name and axes as the variable name indicating the underlying data described above in the function body.
And I found that the names of the starts and ends parameters are also starts_array and ends_array in DenseTensor's slice function:
Paddle/paddle/phi/kernels/impl/slice_kernel_impl.h
Lines 102 to 114 in d1d43c2
There was a problem hiding this comment.
Additionally, the configuration of DenseTensor's slice API in legacy_ops.yaml is:
Paddle/paddle/phi/api/yaml/legacy_ops.yaml
Lines 906 to 913 in cdbf62f
There was a problem hiding this comment.
The signature of the SliceKernel should mainly refers to
Paddle/paddle/phi/kernels/slice_kernel.h
Lines 25 to 32 in d1d43c2
The function mentioned above in Paddle/paddle/phi/kernels/impl/slice_kernel_impl.h is its implementation, and it's better to be the same, If you are interested, can propose another PR to correct the parameter names in slice_kernel_impl.h
There was a problem hiding this comment.
Thanks for your reply! I will propose a PR to correct it when I have free time.
| @jeff41404 Thank you again for your review. Finally, it might be better to use Please see the latest commit for details and review it again! |
PR types
New features
PR changes
APIs
Description
实现第四期 Hackathon 第 29 个任务
中文文档: PaddlePaddle/docs#5895
原始 RFC: PaddlePaddle/community#382
原始 RFC 的修复: PaddlePaddle/community#539