-
Notifications
You must be signed in to change notification settings - Fork 272
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
[Hackathon 3rd No.27 and No.29 ] add paddle.incubate.sparse.any and paddle.incubate.sparse.sum #258
Conversation
|
||
可以参考[torch.sparse.sum](https://pytorch.org/docs/stable/generated/torch.sparse.sum.html#torch.sparse.sum) | ||
sum算子的python端的代码位于torch\sparse\__init__.py (line 153) | ||
C++端的代码位于aten\src\ATen\native\sparse\SparseTensorMath.cpp (line 1515) |
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++的代码,尤其是COO/CSR的支持情况 是否都支持,这里都可以展开说下
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.
竞品Python API命名需要详细说下
|
||
## tensorflow | ||
|
||
可以参考 [tf.sparse.reduce_sum](https://www.tensorflow.org/api_docs/python/tf/sparse/reduce_sum) 和 [tf.sparse.reduce_max](https://www.tensorflow.org/api_docs/python/tf/sparse/reduce_max) 的实现 |
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.
同上
def max(x, axis=None, keepdim=False, name=None) | ||
def min(x, axis=None, keepdim=False, name=None) | ||
``` | ||
考虑是否增加 output_is_sparse=False 这个参数 |
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签名
|
||
# 附件及参考资料 | ||
|
||
本 RFC 参考了https://github.com/PaddlePaddle/community/pull/184,在这里对 |
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系列暂不支持静态图 | ||
|
||
```c | ||
static PyObject* tensor_method_any(TensorObject* self, |
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.
这个实现既有前向,也有反向,不能像is_same_shape那样,那个返回的是一个bool值,没有构建反向网络 比较简单。这个必须要增加OP kernel
C++实现这里需要重写:kernel名、yaml名、大致算法
非常感谢飞桨专家的详细解答,我会尽快搞懂后修改提案。 |
No description provided.