-
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 No.23】为 Paddle 新增 paddle.incubate.sparse.is_same_size 稀疏 API #184
Conversation
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名
paddle.is_same_shape
, 建议API实现放到 python/paddle/tensor/attribute.py 里,且动态图下直接类函数即可 - 动态图下:建议在 paddle/fluid/pybind/eager_method.cc 中实现,作为TensorObject的类成员函数,对比self.tensor.shape是否一致
- 目前不支持静态图,加装饰器@dygraph_only,描述不支持原因:静态图机制目前无法使用SparseCooTensor/SparseCsrTensor
- 单侧补充dense、coo、csr不同类型的9种组合情形
另外需要处理一下冲突 |
要判断的是shape还是size啊 |
按照后面review的来吧,这个任务是我写的最初版,后面详细review时会有一些细节改动 |
已更新 @zhouwei25 |
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签名。整体没有其他问题了
@@ -0,0 +1,88 @@ | |||
# paddle.is_same_shape 设计文档 |
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/incubate/sparse/multiary.py下实现吧,与dense区分下,API签名:paddle.incubate.sparse.is_same_shape。
|
||
## API实现方案 | ||
|
||
参考numpy实现,对比self.tensor.shape是否一致 |
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/fluid/pybind/eager_method.cc 中实现,作为TensorObject的类成员函数,对比self.tensor.shape是否一致。
静态图实现:目前sparse系列暂不支持静态图
|
||
## 命名与参数设计 | ||
|
||
在 python/paddle/tensor/attribute.py 中新增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.
python/paddle/incubate/sparse/multiary.py
已更新 |
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
No description provided.