Skip to content
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 6th No.24】为 paddle.quantile/nanquantile 功能增强 -part #62937

Merged
merged 3 commits into from
Mar 25, 2024

Conversation

Asthestarsfalll
Copy link
Contributor

@Asthestarsfalll Asthestarsfalll commented Mar 21, 2024

PR types

Others

PR changes

APIs

Description

为 paddle.quantile/nanquantile 功能增强

  1. 添加interpolation参数,并适配所有情况
  2. 支持q为1-d和0-d tensor输入
  3. 输出数据类型与输入保持一致

本地单测:
240321_23h03m12s_screenshot
中文文档修改:PaddlePaddle/docs#6353

Copy link

paddle-bot bot commented Mar 21, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Mar 21, 2024
"Type of q should be int, float, list or tuple, or tensor"
)
for q_num in q:
if not in_dynamic_or_pir_mode() and isinstance(q_num, Variable):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

条件判断太多的话,加一下括号包一下

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没懂怎么包

valid_counts = mask.logical_not().sum(
axis=axis, keepdim=True, dtype='float64'
)
valid_counts = mask.logical_not().sum(axis=axis, keepdim=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x如果为int的话受影响吗

@@ -733,42 +774,49 @@ def quantile(x, q, axis=None, keepdim=False):

>>> y1 = paddle.quantile(y, q=0.5, axis=[0, 1])
>>> print(y1)
Tensor(shape=[], dtype=float64, place=Place(cpu), stop_gradient=True,
Tensor(shape=[], dtype=float32, place=Place(cpu), stop_gradient=True,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

输入一个int Tensor试试

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

赛题要求是与torch对齐,但是torch不支持int类型的输入,是否要和torch对齐呢

@luotao1 luotao1 changed the title 【Hackathon 6th No.24】为 paddle.quantile/nanquantile 功能增强 【Hackathon 6th No.24】为 paddle.quantile/nanquantile 功能增强 -part Mar 25, 2024
Copy link
Contributor

@zhwesky2010 zhwesky2010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM,API文档和API映射文档请注意同步修改一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants