Skip to content

refine arange check #74226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Conversation

ooooo-create
Copy link
Contributor

@ooooo-create ooooo-create commented Jul 24, 2025

PR Category

User Experience

PR Types

Improvements

Description

refine arange check https://github.com/PaddlePaddle/Paddle/pull/74159·
主要还是在显式设置 dtype 为 int 类型,在传入底层算子之前会被 cast 成同一类型,所以 inf 会被 cast 成 int 传入导致的,所以在 cast 之前就检查一下。

import paddle
paddle.set_device('gpu')
start = paddle.to_tensor(0)
end = paddle.to_tensor(float('inf'))
a = paddle.arange(start,end,1, dtype=paddle.int32)
print(a)

Copy link

paddle-bot bot commented Jul 24, 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.

@paddle-bot paddle-bot bot added the contributor External developers label Jul 24, 2025
@ooooo-create
Copy link
Contributor Author

/re-run all-failed

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.

Please upload report for BASE (develop@450930c). Learn more about missing BASE report.

Files with missing lines Patch % Lines
paddle/phi/kernels/funcs/range_function.h 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (88.88%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop   #74226   +/-   ##
==========================================
  Coverage           ?   88.88%           
==========================================
  Files              ?        2           
  Lines              ?        9           
  Branches           ?        0           
==========================================
  Hits               ?        8           
  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.

@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants