Skip to content

fix a bug: When x is a scalar, the dtype returned by paddle.where is … #74496

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

hohdiy
Copy link
Contributor

@hohdiy hohdiy commented Aug 8, 2025

PR Category

Operator Mechanism

PR Types

Bug fixes

Description

问题 详情 处理
没有支持out入参   不单独处理,会统一处理
x或者y为scalar时,类型固定为float64   本次修复
cpu下没有支持float16和bfloat16 测试了paddle在gpu下是能够支持float16和bfloat16,即使对应的gpu不支持bfloat16,也没有报错。 本次不修复,涉及底层kernel注册
x和y类型不同时,支持类型提升 目前只有float类型的提升。其他类型和跨类型提升都未实现。 本次不修复

本次修复paddle.where API 在x或者y单独为scalar时,返回的dtype类型不符合预期的问题(应该是float32,而不是float64)。

Copy link

paddle-bot bot commented Aug 8, 2025

你的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.

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

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@c917219). Learn more about missing BASE report.

Additional details and impacted files
@@             Coverage Diff             @@
##             develop    #74496   +/-   ##
===========================================
  Coverage           ?   100.00%           
===========================================
  Files              ?         1           
  Lines              ?         2           
  Branches           ?         0           
===========================================
  Hits               ?         2           
  Misses             ?         0           
  Partials           ?         0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Successfully merging this pull request may close these issues.

3 participants