Pull Request has been successfully merged by CANN-robot.
(Thank you for TangPC's contribution.)变更摘要
本 PR 属于纯注释修正,聚焦于修正若干源文件中注释与实际代码不一致的问题:包括测试文件头部 \file 声明中的文件名,以及若干头文件 #endif 尾注释中引用的头文件保护宏名称。改动仅涉及注释文本,不改变业务逻辑、接口行为或配置默认值。
主要改动
- 修正
fill_diagonal_v2推理测试文件头注释:test_fill_diagonal_v2_infershape.cpp的\file注释由test_fill_diagonal_v2_proto.cpp改为与文件名一致的test_fill_diagonal_v2_infershape.cpp。 - 修正
fill_diagonal_v2tiling 测试头文件尾注释:test_fill_diagonal_v2_tiling.h的#endif尾注释由_FAST_OP_TEST_FILL_DIAGONAL_TILING_H_改为与实际保护宏一致的_FAST_OP_TEST_FILL_DIAGONAL_V2_TILING_H_。 - 修正
fill_v2原型头文件尾注释:fill_v2_proto.h的#endif尾注释由OP_PROTO_FILL_V2_H_改为实际保护宏FILL_V2_PROTO_H_。 - 修正
fills推理测试文件头注释:test_fills_infershape.cpp的\file注释由test_fills_proto.cpp改为test_fills_infershape.cpp。 - 修正
identity_n原型头文件尾注释:identity_n_proto.h的#endif尾注释由SHAPE_N_PROTO_H_改为实际保护宏IDENTITY_N_PROTO_H_。
🧩 本次 Review 已使用自定义 Skill:




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 |
|---|---|---|
| */*/op_graph/*_proto.h | ✅ 王永光, 顾宝成, 王林木 (3/2) | ✅ 王永光 (1/1) |
| conversion/fill_diagonal_v2 | ✅ 王林木, 顾宝成 (2/2) | ✅ 王林木, 顾宝成 (2/1) |
| repo-cann/ops-math | ✅ 王林木, 顾宝成 (2/2) | ✅ 王林木, 顾宝成 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
pingchuantang, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


流水线分析报告 — ops-math run#5537
流水线: https://gitcode.com/CANN/ops-math/actions/runs/37a00b5e33ea4af8aff675ce1ec8213d | PR#6599 | 2026-10-22 15:58:36 ~ 2026-10-22 16:08:43 | 失败 Job 1 个
定界结论: 代码问题 / 代码检查错误 — pre-commit 格式检查未通过(clang-format / 尾随空白 / 文件末尾)
- 失败类型: 代码问题
- 根因:
CodeCheck_precommitJob 中 pre-commit 检查有 3 个 hook 失败:trim trailing whitespace、fix end of files、clang-format, 涉及 PR 变更的 5 个文件(行尾空白/文件末尾换行/C++ 代码格式不符合规范) - 处置建议: 通知 PR 提交者本地执行
pre-commit run --files <变更文件>(或pre-commit run -a)自动修复后重新推送- 参考链接: 本地执行 pre-commit 指导
- 排除项: 其余 hook(check for added large files / merge conflicts / detect private key / codespell / OAT 合规检查)均 Passed; ruff 无 Python 文件需检查(Skipped), 非失败因素
失败根因分析
根因 #1: 代码问题 / 代码检查错误 — pre-commit 三项格式 hook 失败, 涉及 fill_diagonal_v2/fill_v2/fills/identity_n 共 5 个变更文件
- 判据: pre-commit 检查项不通过: clang-format(本地执行 pre-commit run clang-format 修复)
- 定位步骤:
3_precommit.log - 影响 Job: CodeCheck_precommit
- 失败 hook 与涉及文件:
trim trailing whitespace— Failed:conversion/fill_diagonal_v2/tests/ut/op_host/test_fill_diagonal_v2_infershape.cppfix end of files— Failed:conversion/fill_diagonal_v2/tests/ut/op_kernel/test_fill_diagonal_v2_tiling.h,conversion/fill_diagonal_v2/tests/ut/op_host/test_fill_diagonal_v2_infershape.cpp,conversion/fills/tests/ut/op_host/test_fills_infershape.cppclang-format— Failed(自动格式化了以下文件):conversion/fill_diagonal_v2/tests/ut/op_kernel/test_fill_diagonal_v2_tiling.h,conversion/fill_diagonal_v2/tests/ut/op_host/test_fill_diagonal_v2_infershape.cpp,conversion/fill_v2/op_graph/fill_v2_proto.h,conversion/fills/tests/ut/op_host/test_fills_infershape.cpp,conversion/identity_n/op_graph/identity_n_proto.h
- 根因证据(日志原文):
[2026-10-22 16:00:04.468+08:00] trim trailing whitespace.................................................Failed
[2026-10-22 16:00:04.471+08:00] - files were modified by this hook
[2026-10-22 16:00:04.473+08:00] Fixing conversion/fill_diagonal_v2/tests/ut/op_host/test_fill_diagonal_v2_infershape.cpp
[2026-10-22 16:00:04.475+08:00] fix end of files.........................................................Failed
[2026-10-22 16:00:04.480+08:00] Fixing conversion/fill_diagonal_v2/tests/ut/op_kernel/test_fill_diagonal_v2_tiling.h
[2026-10-22 16:00:04.492+08:00] clang-format.............................................................Failed
[2026-10-22 16:00:04.493+08:00] - hook id: clang-format
[2026-10-22 16:00:04.494+08:00] - files were modified by this hook
[2026-10-22 16:00:04.496+08:00] Formatting [1/4] conversion/fill_diagonal_v2/tests/ut/op_kernel/test_fill_diagonal_v2_tiling.h
[2026-10-22 16:00:04.497+08:00] Formatting [2/4] conversion/fill_diagonal_v2/tests/ut/op_host/test_fill_diagonal_v2_infershape.cpp
[2026-10-22 16:00:04.498+08:00] Formatting [3/4] conversion/fill_v2/op_graph/fill_v2_proto.h
[2026-10-22 16:00:04.499+08:00] Formatting [4/4] conversion/fills/tests/ut/op_host/test_fills_infershape.cpp
[2026-10-22 16:00:04.500+08:00] Formatting [1/1] conversion/identity_n/op_graph/identity_n_proto.h
[2026-10-22 16:00:04.568+08:00] ::error::precommit.py 异常退出: exit code=1, signal=null
结构化定界摘要
[{"repo": "ops-math", "run_number": 5537, "Failed_Type": "代码问题",
"Failed_Sub_Type": "代码检查错误",
"Failed_Reason": "CodeCheck_precommit 的 pre-commit 检查失败: clang-format、trim trailing whitespace、fix end of files 三个 hook 不通过, 涉及 fill_diagonal_v2/fill_v2/fills/identity_n 的 5 个变更文件存在代码格式不符、行尾空白、文件末尾换行问题",
"evidence": "clang-format.............................................................Failed",
"suggestion": "通知 PR 提交者本地执行 pre-commit run --files <变更文件> 自动修复格式后重新推送",
"jobs": "CodeCheck_precommit"}]
由门禁失败定界分析自动生成 | repo: ops-math | run: 37a00b5e33ea4af8aff675ce1ec8213d | PR#6599


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


/lgtm
/approve
by agent


您好,PR已满足合入指标,请尽快联系Committer进行合入。如暂时不需要合入,请在PR标题前加[WIP]


/approve


描述
修正以下文件的注释与实际代码不一致问题:
conversion/fill_diagonal_v2/tests/ut/op_host/test_fill_diagonal_v2_infershape.cpp:\file注释由test_fill_diagonal_v2_proto.cpp修正为test_fill_diagonal_v2_infershape.cpp。conversion/fill_diagonal_v2/tests/ut/op_kernel/test_fill_diagonal_v2_tiling.h:#endif尾注释由_FAST_OP_TEST_FILL_DIAGONAL_TILING_H_修正为实际保护宏_FAST_OP_TEST_FILL_DIAGONAL_V2_TILING_H_。conversion/fill_v2/op_graph/fill_v2_proto.h:#endif尾注释由OP_PROTO_FILL_V2_H_修正为实际保护宏FILL_V2_PROTO_H_。conversion/fills/tests/ut/op_host/test_fills_infershape.cpp:\file注释由test_fills_proto.cpp修正为test_fills_infershape.cpp。conversion/identity_n/op_graph/identity_n_proto.h:#endif尾注释由SHAPE_N_PROTO_H_修正为实际保护宏IDENTITY_N_PROTO_H_。此外,按仓库 pre-commit 要求,对被修改文件应用了文件末尾换行/空白/clang-format 修复(仅格式调整,不涉及业务逻辑、接口行为或配置默认值)。
关联的Issue
测试
文档更新
无独立文档文件更新;本次修正源文件注释,并同步仓库要求的格式问题。
类型标签
待确认项
无。