Skip to content

Conversation

@LittleHeroZZZX
Copy link
Contributor

@LittleHeroZZZX LittleHeroZZZX commented Aug 26, 2025

PR Category

User Experience

PR Types

New features

Description

为 Tensor.mul_, mul, diff, cumsum 四个 API 做兼容性改造,并将 multiply 下沉至 C++

  1. Tensor.mul_,是 multiply_ 的别名,inplace op 无法下沉,通过装饰器实现参数别名
  2. mul,无法下沉至C++,通过装饰器支持参数别名,同时支持 out 机制
  3. diff,支持 out
  4. cumsum,支持 out
  5. multiply 下沉至 cpp [API Compatibility] Add out support for 11 APIs #74592 中遗留工作[API Compatiblity] sink matmul and multiply #74899 重复

@paddle-bot
Copy link

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

@LittleHeroZZZX LittleHeroZZZX changed the title [API Compatibilities] Add Tensor.mul_, mul, diff, cumsum, and sink multiply to cpp [API Compatibilities] Add Tensor.mul_, mul, diff, cumsum Aug 27, 2025
Comment on lines 1275 to +1277

@param_two_alias(["x", "input"], ["y", "other"])
def mul(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

multiply 下沉至 C++ 后,通过 python 别名调用 multiply 参数传递异常,孙东建议新开个 API

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.

这个需要处理下冲突

@LittleHeroZZZX
Copy link
Contributor Author

这个需要处理下冲突

Done



@param_two_alias(["x", "input"], ["y", "other"])
def mul(
Copy link
Contributor

@zhwesky2010 zhwesky2010 Aug 27, 2025

Choose a reason for hiding this comment

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

这个后续会把multiply迁回来吗,mul和multiply最好不能出现diff。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@DanielSun11 后续可以支持吗?

Copy link
Contributor

Choose a reason for hiding this comment

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

后续我支持一下 @zhwesky2010

@codecov-commenter
Copy link

Codecov Report

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

Files with missing lines Patch % Lines
python/paddle/tensor/math.py 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop   #74914   +/-   ##
==========================================
  Coverage           ?   93.75%           
==========================================
  Files              ?        2           
  Lines              ?       16           
  Branches           ?        0           
==========================================
  Hits               ?       15           
  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.

@LittleHeroZZZX
Copy link
Contributor Author

/re-run all-failed

Copy link
Contributor

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

@SigureMo 辛苦 Reivew 一下~

@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

@LittleHeroZZZX
Copy link
Contributor Author

/re-run all-failed

@zhwesky2010 zhwesky2010 merged commit 69caf6a into PaddlePaddle:develop Aug 28, 2025
103 of 108 checks passed
@LittleHeroZZZX LittleHeroZZZX deleted the feat/last_pr 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