已合并
补充 strided_slice_v3 infershape UT 用例 #4472
andong_hw创建于 6 天前
补充 strided_slice_v3 infershape UT 用例 #4472
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 andong_hw 的贡献)atomgit-bot
6 天前 评论:
6 天前 评论:
变更摘要
此 PR 主要针对 strided_slice_v3_infershape 算子的形状推导逻辑补充单元测试覆盖率,新增 8 个测试用例,覆盖之前缺失的 DT_INT32 路径、负轴、未知秩、非 const 输入、stride 为零、动态 shape 以及异常分支(无效 axes dtype、axes 越界)等场景,将覆盖率从 71.26% 提升至 94.01%。同时附带了对测试夹具中 SetUpTestCase / TearDownTestCase 的格式整理。
主要改动
- 新增
strided_slice_v3_int32_with_negative_axes用例:验证 DT_INT32 类型的 begin/end/axes/strides 输入与负轴场景下的形状推导正确性。 - 新增
strided_slice_v3_unknown_rank用例:验证输入秩为 -2(未知秩)时,推导输出 shape 仍为{-2}。 - 新增
strided_slice_v3_non_const_axes与strided_slice_v3_non_const_end_strides用例:分别覆盖非 const 的 axes 和非 const 的 end/strides 输入,验证推导结果回退为SetAllUnknownDim(即输出 shape 为{-1, ...})。 - 新增
strided_slice_v3_stride_zero、strided_slice_v3_invalid_axes_dtype、strided_slice_v3_axes_out_of_range用例:覆盖 stride 为 0、axes 的 dtype 非 INT32/INT64、axes 值超出有效范围三种异常路径,均期望返回GRAPH_FAILED。 - 新增
strided_slice_v3_dynamic_shape用例:覆盖输入 shape 含动态维度(-1)时,curAxisInputSize == UNKNOWN_DIM_VALUE_分支的推导行为。


atomgit-bot
6 天前 评论:
6 天前 评论:
6 天前 添加了label:cann-cla/yes
CANN-robot
6 天前 评论:
6 天前 评论:
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
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| conversion/strided_slice_v3 | ✅ jia0liang, zhanw_coding (2/2) | ✅ zhanw_coding (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
andong_hw, thanks for your pull request. All authors of the commits have signed the CLA. 👍


6 天前 将FelixTang7,zhou-qilong,wangrui_,rxtfeng,loov1,zhangzijie,jia0liang,zl_hw,songkai111,pingchuantang,llimwang,gubaocheng,xuejinghui,zhanw_coding设为评审人
6 天前 将FelixTang7,zhou-qilong,wangrui_,rxtfeng,loov1,zhangzijie,jia0liang,zl_hw,songkai111,pingchuantang,llimwang,gubaocheng,xuejinghui,zhanw_coding设为评审人
此处折叠了6条事件消息 查看更多
6 天前 添加了label:cann-cla/yes
6 天前 添加了label:ci-pipeline-running
CANN-robot
6 天前 评论:
6 天前 评论:
流水线任务触发成功
任务链接 [fc7cb53d5e3a4fa292db9dfc03208f22][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_harmony-infer | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910b | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910c | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_A5_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_A5_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station_9030_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single | ✅ SUCCESS | >>>>> | >>>>> |
| UT_Test | ✅ SUCCESS | ||
| UT_Test_experimental | ✅ SUCCESS | ||
| UT_Test_kernel | ✅ SUCCESS | ||
| PreSmoke_A900 | ✅ SUCCESS | >>>>> | |
| API_Check | ✅ SUCCESS | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> | |
| UT_Test_harmony-infer-chs-math | ✅ SUCCESS | ||
| UT_Test_harmony-infer-cpro-math | ✅ SUCCESS |
[2026-08-05 18:15:52] CI执行结束


CANN-robot
6 天前 评论:
6 天前 评论:
流水线任务触发成功
任务链接 [4ef49eda58294a7b813d54ad28846f93][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| SCA | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_Pr | ✅ SUCCESS | ||
| StaticCheck_codespell | ✅ SUCCESS | ||
| StaticCheck_link_validity | ✅ SUCCESS | ||
| StaticCheck_resource_existence | ✅ SUCCESS | ||
| StaticCheck_tag_closed | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_precommit | ✅ SUCCESS | >>>>> |
[2026-08-05 18:06:57] CI执行结束


6 天前 添加了label:api-check-pass
6 天前 删除了label:ci-pipeline-running
6 天前 添加了label:ci-pipeline-passed
zhanw_coding
5 天前 评论:
5 天前 评论:
/lgtm
/approve


5 天前 添加了label:lgtmapproved
5 天前 关闭了关联的issue
5 天前 合入了pull request
关联 Issue
Closes #2533
背景
strided_slice_v3_infershape.cpp覆盖率仅 71.26%(167 行)。现有测试只用 DT_INT64,未覆盖 DT_INT32 路径、负轴、未知秩、非 const 输入、stride==0、动态 shape 等场景。修改内容
新增 6 个 UT 用例:
strided_slice_v3_int32_with_negative_axes:DT_INT32 + 负轴strided_slice_v3_unknown_rank:未知秩输入 {-2}strided_slice_v3_non_const_end_strides:非 const end 和 stridesstrided_slice_v3_stride_zero:stride==0 → GRAPH_FAILEDstrided_slice_v3_dynamic_shape:动态 shape (-1)strided_slice_v3_non_const_axes:非 const axes → SetAllUnknownDimstrided_slice_v3_negative_step_clip:负 step + begin/end 超出范围,覆盖 clipLower/clipUpper验证