-
Notifications
You must be signed in to change notification settings - Fork 263
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.15】为 Paddle 新增 count_nonzero #167
Conversation
# 二、飞桨现状 | ||
目前paddle缺少相关功能实现。 | ||
|
||
API方面,已有相关功能的API,[paddle.nansum](https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/tensor/math.py#L910), 由于容易实现,所以在Paddle中是一个由其他API组合成的API,没有实现自己的OP,其主要实现逻辑为: |
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.
21行和23行不是很通顺,需要再组织下:
- “目前paddle缺少相关功能实现”,和“所以在Paddle中是一个由其他API组合成的API,没有实现自己的OP”,不能对应。是否可以明确为:可以由其他API组合成的API,不需要实现自己的OP?
- 这里引入
nansum
是为什么呢?是因为实现方式类似?
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.
@luotao1 已修改
# 六、测试和验收的考量 | ||
测试考虑的case如下: | ||
|
||
- 和numpy结果的数值的一致性, `paddle.nanmean`,和`np.nanmean`结果是否一致; |
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.nanmean,和
np.nanmean`结果是否一致`这句是忘记删了?
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.
@luotao1 已修改
- 参数`axis`为int,tuple和list时输出的正确性; | ||
- `keepdim`参数的正确性; | ||
- 未输入维度时的输出正确性; | ||
- 测试在进行反向梯度计算时结果的正确性(包含nan值和非nan值位置的梯度); |
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.
(包含nan值和非nan值位置的梯度)的原因是什么呢?
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.
@luotao1 已修改
为 Paddle 新增 count_nonzero