[Cpp API Compatibility] Align ScalarType related APIs#78806
Merged
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #78806 +/- ##
===========================================
Coverage ? 100.00%
===========================================
Files ? 1
Lines ? 4
Branches ? 0
===========================================
Hits ? 4
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This reverts commit 586c99e.
Contributor
Author
|
/re-run all-failed |
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.
PR Category
Execute Infrastructure
PR Types
New features
Description
拆分自 #78707
为 C++ 兼容层(compat)补充 PyTorch 对齐的
ScalarType辅助工具函数与量化类型支持:c10/core/ScalarType.h中新增:isBitsType/isBarebonesUnsignedType:位宽类型与裸无符号类型判断toQIntType:将基础类型映射为对应的量化类型isUnderlying/toRealValueType/toComplexType:类型转换与校验canCast:类型间可转换性检查(拒绝复数→实数、浮点→整数、非 Bool→Bool 等非法转换)torch/headeronly/core/ScalarType.h中新增:isQIntType:量化整数类型判断toUnderlying:量化类型到其底层类型的映射test/cpp/compat/c10_ScalarType_test.cc新增单测,覆盖上述全部辅助函数的行为对齐。是否引起精度变化
否