-
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
【Hackathon 4th No.30】为 Paddle 新增 paddle.sparse.sum 稀疏 API #51406
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
dabe353
to
d2d9baa
Compare
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
@@ -35,6 +35,7 @@ | |||
from .unary import rad2deg | |||
from .unary import expm1 | |||
from .unary import transpose | |||
from .unary import sum | |||
from .unary import reshape | |||
from .unary import isnan |
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.
__all__ =
55行是不是少加了sum
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.
__all__里面加上sum,否则文档不会暴露在官网
__all__ = [
'sparse_coo_tensor',
...
]
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文档pr链接
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.
好的,已添加
PaddlePaddle/docs#5846
@luotao1 麻烦帮忙看下这个ci时怎么回事,重试了好几次依然还是错误,也重新push了几次把develop最新的内容也合入了。civerage是正常的,只有build那几个一直失败 |
你可以贴一下build成功/失败的diff,目前CI develop的build是正常的,所以需要看下diff是什么,修改了哪些代码,commit太多了,看不出来。 |
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/paddle/sparse/unary.py
Outdated
|
||
Returns: | ||
Tensor: Results of summation operation on the specified axis of input Tensor `x`, | ||
if `x.dtype='bool'`, `x.dtype='int32'`, it's data type is `'int64'`, |
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.
建议改成
- if
x.dtype='bool'
orx.dtype='int32'
,否则容易造成误解。 - 上一句的末尾改成句号吧
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
@zrr1999 辛苦更新下示例代码 |
好的,已修改 |
PR types
New features
PR changes
APIs
Description
Add paddle.sparse.sum
document pr: PaddlePaddle/docs#5846
rfc pr: PaddlePaddle/community#411
特殊说明
对于coo格式的稀疏张量,即使keep_dim为False,得到的结果张量的sparse_dim以及dense_dims.size()也会不小于1。
即当x.shape=[5,5],x.sparse_dim=1时,keep_dim=False
y=sum(x, axis=0)
z=sum(x, axis=1)
得到
y.shape=[1,5],y.sparse_dim=1
z.shape=[5,1],z.sparse_dim=1