Skip to content

Conversation

@Difers
Copy link
Contributor

@Difers Difers commented Aug 7, 2025

PR Category

User Experience

PR Types

New features

Description

Pcard-73145
增加paddle.Tensor.type_as

@paddle-bot
Copy link

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

@zhwesky2010 zhwesky2010 changed the title [API compatibility]add type_as [API compatibility]add Tensor.type_as Aug 7, 2025
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.

这个加一些测试吧

@codecov-commenter
Copy link

codecov-commenter commented Aug 7, 2025

Codecov Report

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

Files with missing lines Patch % Lines
python/paddle/base/layers/math_op_patch.py 50.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (83.33%) 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 #74459 +/- ## ========================================== Coverage ? 83.33% ========================================== Files ? 3 Lines ? 6 Branches ? 0 ========================================== Hits ? 5 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.
SigureMo
SigureMo previously approved these changes Aug 7, 2025
@zhwesky2010
Copy link
Contributor

@Difers 测试记得加一下

@Difers
Copy link
Contributor Author

Difers commented Aug 8, 2025

@Difers 测试记得加一下

已添加,麻烦再review下~

return x.astype(y.dtype)


class TestTypeAsBase(unittest.TestCase):
Copy link
Contributor

Choose a reason for hiding this comment

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

你这个单测里没看到调用Tensor.type_as呢

Copy link
Contributor Author

Choose a reason for hiding this comment

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

笔误,已修改~

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

@Difers
Copy link
Contributor Author

Difers commented Aug 12, 2025

/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

@zhwesky2010 zhwesky2010 merged commit f1ae790 into PaddlePaddle:develop Aug 13, 2025
112 of 118 checks passed
maxiaolong001 pushed a commit to maxiaolong001/Paddle that referenced this pull request Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment