-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[API compatibility] add broadcast_shapes api #74594
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
[API compatibility] add broadcast_shapes api #74594
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
python/paddle/tensor/math.py
Outdated
| >>> # ValueError (terminated with error message). | ||
| """ | ||
| if len(shapes) < 2: |
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.
这里直接展开判断吧,避免判断2次
if len==0:
elif len==1:
else:
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.
Done
zhwesky2010
left a comment
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
XiaoguangHu01
left a comment
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
Codecov Report❌ Patch coverage is
❌ 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. 🚀 New features to boost your workflow:
|
PR Category
User ExperiencePR Types
New featuresDescription
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