Skip to content

Conversation

@zhengshengning
Copy link
Contributor

PR Category

Operator Mechanism

PR Types

New features

Description

[ 仅参数名不一致 ]torch.broadcast_to
api参数映射关系:点击链接

  1. 增加参数装饰器;
  2. 单测已存在:/test/legacy_test/test_broadcast_to_op.py

测试:

>>> import paddle >>> x = paddle.to_tensor([1, 2, 3]) >>> y = paddle.broadcast_to(x, [2, 3]) >>> print(y.shape) [2, 3] >>> >>> y = paddle.broadcast_to(x, size=[2, 3]) >>> print(y.shape) [2, 3] >>> >>> y = paddle.broadcast_to(input=x, size=[2, 3]) >>> print(y.shape) [2, 3] >>> >>> >>> y = paddle.broadcast_to(x=x, size=[2, 3]) >>> print(y.shape) [2, 3] 

pcard-67164

@paddle-bot
Copy link

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

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 84.44444% with 7 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@698721e). Learn more about missing BASE report.

Files with missing lines Patch % Lines
python/paddle/utils/decorator_utils.py 83.72% 7 Missing ⚠️

❌ Your patch status has failed because the patch coverage (84.44%) 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 #74449 +/- ## ========================================== Coverage ? 84.44% ========================================== Files ? 2 Lines ? 45 Branches ? 0 ========================================== Hits ? 38 Misses ? 7 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.
@zhengshengning
Copy link
Contributor Author

/re-run all-failed

@zhangbo9674 zhangbo9674 merged commit 4614b93 into PaddlePaddle:develop Aug 7, 2025
78 of 81 checks passed
Enigmatisms pushed a commit to Enigmatisms/Paddle that referenced this pull request Aug 9, 2025
) * add torch_to_paddle_decorator * add DecoratorBase
@zhengshengning zhengshengning changed the title Parameter mapping from torch to paddle(broadcast_to) [API compatibility] Parameter mapping from torch to paddle(broadcast_to) Sep 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

4 participants