已合并
fix: 删除硬编码DT_MAX边界值的测试用例&&gaf用例修复 #4846
yelongjian创建于 10 小时前
fix: 删除硬编码DT_MAX边界值的测试用例&&gaf用例修复 #4846
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 yelongjian 的贡献)10 小时前 创建了 pull request,commit 90ef3bb7
atomgit-bot
10 小时前 评论:
10 小时前 评论:
变更摘要
该 PR 旨在修复因新 CANN 包新增 DT_HIFLOAT4_SCALE 数据类型导致 DT_MAX 从 43 变为 44 后、硬编码 DT_MAX 边界值的测试用例断言失败的问题。本次共删除 2 个测试文件中 4 个硬编码 DT_MAX=43 边界值的用例(共删除 36 行、无新增),后续将改为动态获取 DT_MAX 值。
主要改动
- 删除 C++ 端非法 dtype 边界用例:在
tests/graph_metadef/ut/graph/testcase/inference_rule_unittest.cc中删除InferenceRuleUtest下的InvalidDtype1、InvalidDtype2、InvalidDtype3三个用例,它们均在断言错误信息中硬编码了[0,43(DT_MAX))的范围描述。 - 删除 Python 端 DT_MAX 边界用例:在
tests/ge/ut/ge/graph/pyge_tests/python_custom_op_proto_test.py中删除test_tensor_desc_rejects_data_type_boundary,该用例直接以DataType.DT_MAX作为入参并断言"less than DataType.DT_MAX"错误信息,无法适配DT_MAX的动态变化。 - 统一移除对固定 DT_MAX 数值的依赖:两处改动均为纯删除(无新增代码),消除测试对
DT_MAX=43这一具体取值的耦合,使测试在新镜像(DT_MAX=44)下不再因边界值变化而失败。


不准确?
atomgit-bot
10 小时前 评论:
10 小时前 评论:
10 小时前 添加了label:cann-cla/yes
CANN-robot
10 小时前 评论:
10 小时前 评论:
Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/ge | ✅ zhanj, yangyongqiang0606, kobemini (3/2) | ✅ yangyongqiang0606 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
yelongjian, thanks for your pull request. All authors of the commits have signed the CLA. 👍


此处折叠了56条消息 查看更多
GengChao
3 小时前 评论:
3 小时前 评论:
/lgtm


3 小时前 添加了label:lgtm
yangyongqiang
3 小时前 评论:
3 小时前 评论:
/approve


3 小时前 添加了label:approved
3 小时前 合入了pull request
Pull Request
描述
新镜像 CANN 包新增 DT_HIFLOAT4_SCALE 数据类型(DT_MAX 从 43 变为 44),导致以下硬编码 DT_MAX 边界值的测试用例失败:
InferenceRuleUtest.InvalidDtype1、InvalidDtype2、InvalidDtype3(C++,inference_rule_unittest.cc)test_tensor_desc_rejects_data_type_boundary(Python,python_custom_op_proto_test.py)本次删除这些硬编码 DT_MAX 的测试用例,后续改为动态获取 DT_MAX 值。
变更类型
关联的Issue
如何测试
核对清单
其他信息
删除的用例均因硬编码 DT_MAX=43 导致在新 CANN 包(DT_MAX=44)下断言失败,属于测试用例本身未适配 DT_MAX 动态变化的问题。