Open
docs: fix Tensor construction examples to compile #94
SuneeAdd on Oct 24
docs: fix Tensor construction examples to compile #94
Open
Merge blocked
Oct 24 Modify description of pull request
Oct 24 Added label: cann-cla/yes
CANN-robot
Oct 24 Comments:
Oct 24 Comments:
CANN-robot
Oct 24 Comments:
Oct 24 Comments:
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
⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/atvoss | ❌ (0/2)(You can also ask: 王瑞, 王林木, 周奇龙, 冯彤, 顾宝成) | ❌ (0/1)(You can also ask: 冯彤, 顾宝成, 徐鲁威, jia0liang, 王瑞) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)


Oct 24 Set zhou-qilong,wangrui_,rxtfeng,loov1,jia0liang,llimwang,gubaocheng as approver
Oct 24 Set zhou-qilong,wangrui_,rxtfeng,loov1,jia0liang,llimwang,gubaocheng as approver
Sunee
Oct 24 Comments:
Oct 24 Comments:
compile


Oct 24 Added label: ci-pipeline-running
CANN-robot
Oct 24 Comments:
Oct 24 Comments:
流水线任务触发成功
任务链接 [ceb3df4e80a040c6b0654f1f4448e4fe][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| Check_Pr | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| pre_comment | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| cocheck_codestyle | ✅ SUCCESS | ||
| precommit | ⚠️ WARNING | >>>>> | >>>>> |
| UT_Test | ✅ SUCCESS | ||
| ST_Test | ✅ SUCCESS | ||
| API_Check | ✅ SUCCESS | >>>>> |
[2026-10-24 10:10:00] CI执行结束


Oct 24 Added label: api-check-pass
Oct 24 Removed label: ci-pipeline-running
Oct 24 Added label: ci-pipeline-passed
描述
修复
docs/api下 17 篇文档「使用示例」中 Tensor 构造的花括号初始化写法,该写法无法编译。原示例形如:
Atvoss::Tensor<InputDtype> in1(deviceIn1, {{3, 4, 0, 0, 0, 0, 0, 0}}, 2);include/utils/tensor.h仅提供Tensor(T*, uint64_t (&)[N])、Tensor(T*, uint64_t*, size_t)、Tensor(T*, int64_t*, size_t)三个构造;三参数调用的第 2 个实参是花括号初始化列表,不能绑定到原始指针参数,g++ -std=c++17报no matching function for call。修复方式(对齐
examples/rms_norm/rms_norm.cpp的既有写法):每个示例先声明一次uint64_t shapeArray[8] = {3, 4, 0, 0, 0, 0, 0, 0};,再以(device, shapeArray, 2)传入。shape 值与维数不变,未修改Tensor实现或构造签名。涉及 17 篇文档、共 51 处:
ArgumentsBuilder_attr.md、ArgumentsBuilderImpl_build.md、ArgumentsBuilder_inputOutput.md、BlockBuilder.md、Compute.md、DefaultBlockConfig.md、DefaultBlockPolicy.md、DefaultBlockSchedule.md、DefaultKernelConfig.md、DefaultKernelPolicy.md、DefaultKernelSchedule.md、DeviceAdapter.md、DeviceAdapter_Run.md、KernelBuilder.md、ParamUsage.md、PlaceHolder.md、PlaceHolderTmpLike.md。
关联的Issue
Fixes #60
测试
Tensor<float> in1(dev, {{3, 4, 0, 0, 0, 0, 0, 0}}, 2),g++ -std=c++17 -fsyntax-only -Iinclude复现no matching function for call。uint64_t shapeArray[8] = {...}; Tensor<float> in1(dev, shapeArray, 2)编译通过(exit 0)。in1构造之前;全文无残留{{3, 4, 0, 0, 0, 0, 0, 0}}。文档更新
更新
docs/api下 17 篇文档的使用示例(Tensor 构造写法)。类型标签