[API Compatibility No.10] Add parameter alias support for floor_divide_ -part#77556
Open
CAICAIIs wants to merge 2 commits intoPaddlePaddle:developfrom
Open
[API Compatibility No.10] Add parameter alias support for floor_divide_ -part#77556CAICAIIs wants to merge 2 commits intoPaddlePaddle:developfrom
CAICAIIs wants to merge 2 commits intoPaddlePaddle:developfrom
Conversation
…e_ -part Add parameter alias support for paddle.Tensor.floor_divide_: - Add @param_two_alias decorator to support 'input' as alias for 'x' and 'other' as alias for 'y' - Add tests for parameter alias support including: - test_floor_divide_inplace_with_y_parameter: Test using 'y' parameter - test_floor_divide_inplace_with_other_parameter: Test using 'other' parameter (alias) - test_floor_divide_inplace_with_both_parameters_error: Test that using both 'y' and 'other' raises TypeError ## Changes - python/paddle/tensor/math.py: Added @param_two_alias decorator to floor_divide_ function - test/legacy_test/test_inplace.py: Added three test methods for parameter alias support ## Fixes - Fixes PaddlePaddle#76301 task 10
|
你的PR提交成功,感谢你对开源项目的贡献! |
Author
|
PaConvert: PaddlePaddle/PaConvert#818 |
zhwesky2010
reviewed
Jan 29, 2026
Contributor
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Task #76301 No.10 aims to align torch.Tensor.floor_divide_ with paddle.Tensor.floor_divide_. The key requirement is to support PyTorch-style parameter names (other instead of y) to ensure smooth migration for PyTorch users.
Implementation
Example Usage
After this PR, both PyTorch and Paddle styles work:
Changes
Fixes
PR Category
User Experience
PR Types
New features
Description
This PR adds PyTorch parameter alias support for paddle.Tensor.floor_divide_ API.