Skip to content

Conversation

@Starrysea996
Copy link
Contributor

PR Category

User Experience

PR Types

New features

Description

Use broadcast_shape api to implement broadcast_shapes for paddle, similar to torch.broadcast_shapes

Tested various scenarios such as zero dimension, empty dimension, multiple shapes, etc

@paddle-bot
Copy link

paddle-bot bot commented Aug 13, 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.

>>> # ValueError (terminated with error message).
"""
if len(shapes) < 2:
Copy link
Contributor

Choose a reason for hiding this comment

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

这里直接展开判断吧,避免判断2次
if len==0:
elif len==1:
else:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

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

@zhwesky2010 zhwesky2010 requested a review from SigureMo August 14, 2025 09:35
Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 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

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@f1ae790). Learn more about missing BASE report.

Files with missing lines Patch % Lines
python/paddle/tensor/math.py 66.66% 2 Missing ⚠️

❌ Your patch status has failed because the patch coverage (66.66%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop   #74594   +/-   ##
==========================================
  Coverage           ?   66.66%           
==========================================
  Files              ?        1           
  Lines              ?        6           
  Branches           ?        0           
==========================================
  Hits               ?        4           
  Misses             ?        2           
  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.

@zhwesky2010 zhwesky2010 merged commit d77dd90 into PaddlePaddle:develop Aug 15, 2025
111 of 125 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants