Pull Request已成功合入, 合并人@CANN-robot
(感谢 mclll 的贡献)变更摘要
本 PR 是 #238 质量加固要求的一部分,在 autofuse/ascir/meta/ascendc_graph_txt_dumper.cpp 中为 10 个初始化后不再修改的局部变量添加 const 修饰(均为 auto → const auto),以降低误修改风险。改动仅涉及代码风格,不改变任何运行逻辑,并通过了 git diff --check 校验。
主要改动
GetDtypeInfo中只读迭代器加const:kDtypeInfoMap.find(dtype)的返回值由auto it改为const auto it,该迭代器仅用于查找与读取,不参与后续写入。GetTensorTypeStr中类型与形状相关局部变量加const:attr.dtype改为const auto dtype;形状循环中的attr.axis[i]、attr.repeats[i]分别改为const auto axis_id、const auto repeat,两处axis_id_to_name.find(axis_id)的迭代器也改为const auto it,均为只读查询使用。BuildDumpContext中节点类型加const:node->GetType()的返回值由auto node_type改为const auto node_type,仅用于与NodeType::kData等常量比较。CollectInputNames中锚点与节点名加const:node->GetInDataAnchor(...)、in_anchor->GetPeerOutAnchor()、peer_out_anchor->GetOwnerNode()->GetName()的返回值分别改为const auto in_anchor、const auto peer_out_anchor、const auto peer_name,这些变量仅用于判空、读取索引与节点名称。


Hi @mclll, welcome to submitting your first PR to graph-autofusion!
PR Merge Steps
1. CLA Signing
If the current PR label includes cann-cla/yes, it means you have signed the CLA and can proceed to the next step. If the label includes cann-cla/no, please sign the CLA first. If you have any questions, please refer to the FAQ.
2. CI Check
Please comment /compile to trigger the CI pipeline check. If the CI run is successful, the PR will be tagged with ci-pipeline-passed and you can proceed to the next step. If the CI run fails, the PR will be tagged with ci-pipeline-failed, please check the CI logs to fix the issues in the PR. If you have any questions, please refer to the FAQ.
3. Code Review
After CI passes, please refer to the PR Approval Progress and proactively @ the committers in the table to review the code. After approval, committers will comment /lgtm and /approve. Once the lgtm and approved labels are successfully added, the PR will be merged automatically.


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/graph-autofusion | ✅ xuyafei, 张德鹏, xchu42 (3/2) | ✅ 张德鹏 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)


流水线任务触发成功
任务链接 [65bd4de76c0745388f731832ed48a3cf][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| UT_Test_Python_superkernel | ✅ SUCCESS | >>>>> | |
| ST_Test_Python_superkernel | ✅ SUCCESS | >>>>> | |
| UT_Test_superkernel | ✅ SUCCESS | >>>>> | |
| UT_Test_autofuse_framework | ✅ SUCCESS | >>>>> | |
| ST_Test_autofuse_framework | ✅ SUCCESS | >>>>> | |
| UT_Test_autofuse_ascendc_api | ✅ SUCCESS | >>>>> | |
| ST_Test_autofuse_ascendc_api | ❌ FAILED | >>>>> | |
| ST_Test_autofuse_e2e | ✅ SUCCESS | >>>>> | |
| pre_comment | ✅ SUCCESS | >>>>> |


流水线任务触发成功
任务链接 [5ea48bea44ee439f9bcb1b6055a9723c][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| UT_Test_Python_superkernel | ✅ SUCCESS | >>>>> | |
| ST_Test_Python_superkernel | ✅ SUCCESS | >>>>> | |
| UT_Test_superkernel | ✅ SUCCESS | >>>>> | |
| UT_Test_autofuse_framework | ✅ SUCCESS | >>>>> | |
| ST_Test_autofuse_framework | ❌ FAILED | >>>>> | |
| UT_Test_autofuse_ascendc_api | ✅ SUCCESS | >>>>> | |
| ST_Test_autofuse_ascendc_api | ❌ FAILED | >>>>> | |
| ST_Test_autofuse_e2e | ✅ SUCCESS | >>>>> | |
| pre_comment | ✅ SUCCESS | >>>>> |


流水线任务触发成功
任务链接 [9dcac7eec5d94632ae0017cc47928ded][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| UT_Test_Python_superkernel | ✅ SUCCESS | >>>>> | |
| ST_Test_Python_superkernel | ✅ SUCCESS | >>>>> | |
| UT_Test_superkernel | ✅ SUCCESS | >>>>> | |
| UT_Test_autofuse_framework | ✅ SUCCESS | >>>>> | |
| ST_Test_autofuse_framework | ✅ SUCCESS | >>>>> | |
| UT_Test_autofuse_ascendc_api | ✅ SUCCESS | >>>>> | |
| ST_Test_autofuse_ascendc_api | ✅ SUCCESS | >>>>> | |
| ST_Test_autofuse_e2e | ✅ SUCCESS | >>>>> | |
| pre_comment | ✅ SUCCESS | >>>>> | |
| UT_Test_Report | ✅ SUCCESS | >>>>> | |
| ST_Test_Report | ✅ SUCCESS | >>>>> |
[2026-08-24 14:49:50] CI执行结束


/lgtm


Pull Request
描述
本 PR 按 #238 质量加固要求,在
autofuse/ascir/meta/ascendc_graph_txt_dumper.cpp中为 10 个初始化后不再修改的局部变量添加const修饰,减少误修改风险。变更类型
关联的Issue
#238
如何测试
git diff --check,通过。const修改均已生效。核对清单