Pull Request已成功合入, 合并人@CANN-robot
(感谢 Sun 的贡献)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 |
|---|---|---|
| repo-cann/ops-math | ✅ zl_hw, songkai111 (2/2) | ✅ songkai111 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
LuckySun, thanks for your pull request. All authors of the commits have signed the CLA. 👍


🔵 source code change are detected, tasks labels is removed in this pull request!


问题/功能描述
本次PR主要解决了CANN算子库中加法算子(AddExample)的文档和示例代码存在的演示效果不佳问题。具体包括:1)相关Markdown文档中的示例输出过于简单(如“1+1=2”),无法有效展示算子的实际计算效果;2)示例程序的输入数据单一、输出打印不清晰,导致演示效果和可读性较差。通过优化,旨在使文档和代码示例更贴近真实测试场景,便于用户理解和验证。
修改方案描述
修改方案分为两部分:1)统一更新了快速入门、算子调用和仿真工具等多个Markdown文档,将其中AddExample算子的单调示例输出替换为包含标题行和10组不同数值(含正负数)的详细输出。2)优化了加法算子示例程序的代码,改进了输入数据生成方式(如使用递增数列和可控随机数)并优化了结果打印逻辑(如增加提示、限制打印数量)。所有修改均不涉及核心算法、安全配置或构建逻辑,仅用于提升文档和示例的清晰度与实用性。


compile


流水线任务触发成功
任务链接 [169847be7c8947f89666c42f80c1abcd][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| anti_virus | ✅ SUCCESS | >>>>> | |
| Check_Pr | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_A5 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_A5 | ✅ SUCCESS | >>>>> | >>>>> |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_A5_ubuntu24 | ✅ SUCCESS | >>>>> | |
| harmony-infer | ✅ SUCCESS | ||
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_single_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_A5_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_X86_monitor | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_ARM_monitor | ✅ SUCCESS | >>>>> | >>>>> |
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| UT_Test | ✅ SUCCESS | ||
| UT_Test_experimental | ✅ SUCCESS | ||
| UT_Test_kernel | ✅ SUCCESS | ||
| Smoke_A900_npupool | ✅ SUCCESS | >>>>> | |
| API_Check | ✅ SUCCESS | >>>>> | |
| ATK_Test_A2 | ✅ SUCCESS |
[2026-03-31 15:24:37] CI执行结束


/lgtm
/approve


Review Guide
This pull-request passes review.
Committers who wrote a comment of /approve are: songkai111.
Reviewers who wrote a comment of /lgtm are: songkai111, zl_hw.


The MR can not be merged, because of CodeReview discussion not resolved
If you want to solve this problem, you can click here to do it in the FAQs.


The following labels are not ready.
lgtm: The label was added before the last update of the PR. Please re-add it after the latest update.
approved: The label was added before the last update of the PR. Please re-add it after the latest update.
ci-pipeline-passed: The label was added before the last update of the PR. Please re-add it after the latest update.


🔵 source code change are detected, tasks labels is removed in this pull request!


compile


流水线任务触发成功
任务链接 [f41db17507884585aa237dec1d972b1a][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| anti_virus | ✅ SUCCESS | >>>>> | |
| Check_Pr | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_A5 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_A5 | ✅ SUCCESS | >>>>> | >>>>> |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_A5_ubuntu24 | ✅ SUCCESS | >>>>> | |
| harmony-infer | ✅ SUCCESS | ||
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_single_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_A5_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_X86_monitor | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_ARM_monitor | ✅ SUCCESS | >>>>> | >>>>> |
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| cocheck_codestyle | ✅ SUCCESS | ||
| UT_Test | ✅ SUCCESS | ||
| UT_Test_experimental | ✅ SUCCESS | ||
| UT_Test_kernel | ✅ SUCCESS | ||
| Smoke_A900_npupool | ✅ SUCCESS | >>>>> | |
| API_Check | ✅ SUCCESS | >>>>> | |
| ATK_Test_A2 | ✅ SUCCESS |
[2026-03-31 19:30:12] CI执行结束


/lgtm
/approve


Review Guide
This pull-request passes review.
Committers who wrote a comment of /approve are: songkai111.
Reviewers who wrote a comment of /lgtm are: zl_hw, songkai111.


描述
修改add_example的输入数据,使用指定种子的随机数,增加多样化。
指定add_example输出长度,防止被大量日志淹没。
配套修改文档中展示add_example的结果的内容。
关联的Issue
https://gitcode.com/cann/ops-math/issues/1133
https://gitcode.com/cann/ops-math/issues/1094
测试
样例运行正常,不同机器上随机数结果一致
文档更新
docs/QUICKSTART.md
docs/zh/debug/cann_sim.md
docs/zh/invocation/op_invocation.md
类型标签