Skip to content

[Cherry-pick][release/3.3] Fix the problem of size accuracy when using arange/range with different input and output types#78787

Open
omoYang wants to merge 1 commit intoPaddlePaddle:release/3.3from
omoYang:cherry-pick/release-3.3/arange-precision
Open

[Cherry-pick][release/3.3] Fix the problem of size accuracy when using arange/range with different input and output types#78787
omoYang wants to merge 1 commit intoPaddlePaddle:release/3.3from
omoYang:cherry-pick/release-3.3/arange-precision

Conversation

@omoYang
Copy link
Copy Markdown
Contributor

@omoYang omoYang commented Apr 24, 2026

Summary

Cherry-pick from #78747 to release/3.3

  • Fix the accuracy problem in paddle.arange() and paddle.range() caused by forced type transformation between input and output
  • Modified type used in shape calculation with appropriate type conversion
  • Added NaN and Inf checks for floating-point inputs

PR Category

Operator Mechanism

PR Types

Bug fixes

@paddle-bot
Copy link
Copy Markdown

paddle-bot Bot commented Apr 24, 2026

你的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.

@paddle-bot paddle-bot Bot added the contributor External developers label Apr 24, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 93.91304% with 7 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release/3.3@2b9f8b6). Learn more about missing BASE report.

Files with missing lines Patch % Lines
paddle/phi/kernels/funcs/range_function.h 0.00% 4 Missing ⚠️
paddle/phi/kernels/cpu/range_kernel.cc 92.59% 2 Missing ⚠️
python/paddle/tensor/creation.py 95.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff               @@
##             release/3.3   #78787   +/-   ##
==============================================
  Coverage               ?   93.91%           
==============================================
  Files                  ?        7           
  Lines                  ?      115           
  Branches               ?        0           
==============================================
  Hits                   ?      108           
  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.

@omoYang omoYang force-pushed the cherry-pick/release-3.3/arange-precision branch from 96c9485 to bb30696 Compare April 30, 2026 09:14
…ent input and output types.

    Co-authored-by: omoYang <1115418865@qq.com>
    Co-authored-by: SigureMo <sigure.qaq@gmail.com>
@omoYang omoYang force-pushed the cherry-pick/release-3.3/arange-precision branch from bb30696 to 3d4b51d Compare May 1, 2026 17:13
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


yangyang123 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants