Skip to content

Conversation

aquagull
Copy link
Contributor

@aquagull aquagull commented Aug 11, 2025

PR Category

User Experience

PR Types

Others

Description

  1. 新增api paddle.permute paddle.Tensor.permute
  2. paddle.Tensor.repeat的dims支持可变参数
    image

Copy link

paddle-bot bot commented Aug 11, 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-commenter commented Aug 11, 2025

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@8321bbb). Learn more about missing BASE report.

Files with missing lines Patch % Lines
python/paddle/utils/decorator_utils.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop   #74525   +/-   ##
==========================================
  Coverage           ?   92.85%           
==========================================
  Files              ?        2           
  Lines              ?       14           
  Branches           ?        0           
==========================================
  Hits               ?       13           
  Misses             ?        1           
  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.

) -> Tensor: ...


@overload
Copy link
Contributor

@zhwesky2010 zhwesky2010 Aug 11, 2025

Choose a reason for hiding this comment

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

torch.permute只支持两个参数传入,input、dims
infoflow 2025-08-11 19-38-10

transpose加一个参数别名的装饰器,然后将permute别名到transpose就可以。

@aquagull aquagull requested a review from zhwesky2010 August 12, 2025 03:27
@zhwesky2010
Copy link
Contributor

可变参数的用法参考 SizeArgsDecorator 实现吧,API签名还是正常写

) -> tuple[tuple[Any, ...], dict[str, Any]]:
if len(args) >= 2 and isinstance(args[1], int):
kwargs[self.var] = list(args[1:])
args = args[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

对于paddle.permute(x, 1, 2, 0)

是处理成 args=1, kwargs={'dims', [2, 0]} 吗,感觉不太对,应该是整个 args都被处理成list吧,list(args)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

args[0]应该是x,不过这里应该写成args[:1]也就是(x, ),我更改下。
image

@aquagull
Copy link
Contributor Author

/re-run all-failed

1 similar comment
@aquagull
Copy link
Contributor Author

/re-run all-failed

zhwesky2010
zhwesky2010 previously approved these changes Aug 13, 2025
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 13, 2025 12:18
SigureMo
SigureMo previously approved these changes Aug 13, 2025
@aquagull aquagull dismissed stale reviews from SigureMo and zhwesky2010 via 37b3fd9 August 14, 2025 02:34
SigureMo
SigureMo previously approved these changes Aug 14, 2025
zhwesky2010
zhwesky2010 previously approved these changes Aug 14, 2025
zhwesky2010
zhwesky2010 previously approved these changes Aug 14, 2025
SigureMo
SigureMo previously approved these changes Aug 14, 2025
XiaoguangHu01
XiaoguangHu01 previously approved these changes Aug 14, 2025
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

@aquagull aquagull dismissed stale reviews from XiaoguangHu01, SigureMo, and zhwesky2010 via 53fee70 August 15, 2025 13:13
@aquagull
Copy link
Contributor Author

/re-run all-failed

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

@zhwesky2010 zhwesky2010 merged commit 28c0f43 into PaddlePaddle:develop Aug 18, 2025
171 of 185 checks passed
Luckycheng222 pushed a commit to Luckycheng222/Paddle that referenced this pull request Aug 25, 2025
…addle#74525)

* add permute api

* fix

* code-style

* fix

* update

* update

* update

* code style

* fix doc

* fix

---------

Co-authored-by: aquagull <[email protected]>
@aquagull aquagull deleted the permute branch September 12, 2025 03:10
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.

5 participants