Skip to content

Conversation

@LittleHeroZZZX
Copy link
Contributor

@LittleHeroZZZX LittleHeroZZZX commented Aug 8, 2025

PR Category

User Experience

PR Types

New features

Description

新增三个对齐 torch 的API:pp.Tensor.mul_, pp.autograd.Function, pp.argwhere
pp.Tensor.mul_:相较 pp.multiply,支持第二个参数为标量
pp.autograd.Function:为 pp.autograd.Layer 的别名
pp.argwhere: 为 pp.nonzero 的子集,去掉as_tuple 参数。

image

@paddle-bot
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.

[2, 4, 6]]])
"""
other_tensor = (
Copy link
Contributor

Choose a reason for hiding this comment

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

这个后面会统一开展,即二元函数支持scalar。

目前就写别名就可以

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

@LittleHeroZZZX
Copy link
Contributor Author

/re-run all-failed

@zhwesky2010 zhwesky2010 requested a review from SigureMo August 11, 2025 11:11
@LittleHeroZZZX
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

Copy link
Contributor

@jeff41404 jeff41404 left a comment

Choose a reason for hiding this comment

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

LGTM

@LittleHeroZZZX
Copy link
Contributor Author

/re-run all-failed

@zhwesky2010 zhwesky2010 merged commit a3e6c07 into PaddlePaddle:develop Aug 12, 2025
146 of 155 checks passed
maxiaolong001 pushed a commit to maxiaolong001/Paddle that referenced this pull request Aug 13, 2025
…here (PaddlePaddle#74493)

* Add pp.Tensor.mul_, pp.autograd.Function, pp.argwhere

* Remove scalar support for mul and mul_
@LittleHeroZZZX LittleHeroZZZX deleted the feat/group1 branch November 11, 2025 06:12
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