Pull Request已成功合入, 合并人@CANN-robot
(感谢 wuchengming 的贡献)变更摘要
此 PR 修复了 concat 算子在处理非连续(non-contiguous)tensor 时,srcOffset 计算未正确使用每个 tensor 自身 dim0stride 的问题。核心变更是将 CopyInSplitDim1 函数的参数 srcOffset(预乘了 sameShapeTensorDim1)改为 srcRowsOffset(纯行偏移),并在每次调用 CopyInSingleTensor 时使用当前 tensor 的 dim0stride 动态计算实际源地址偏移,从而保证非连续 tensor 场景下地址计算的正确性。
主要改动
-
CopyInSplitDim1参数语义修正:将参数srcOffset重命名为srcRowsOffset,其含义从"预乘 dim1 长度的字节偏移"变为"纯行偏移"。调用方不再传入i * ubFactorDim0 * sameShapeTensorDim1,而是传入i * ubFactorDim0。 -
CopyInSingleTensor调用处的 srcOffset 计算修复:在CopyInSplitDim1内部,原来直接使用srcOffset + splitInfo.startOffset作为源偏移;现在改为srcRowsOffset * dim0stride + splitInfo.startOffset,其中dim0stride通过GetTensorDim0Stride按当前 tensor 索引实时获取,确保非连续 tensor 使用各自正确的步长。 -
跨 tensor 循环内的偏移计算修复:在
CopyInSplitDim1遍历多个 tensor 的循环中(含中间 tensor 和末尾endIdxtensor),原来统一使用srcOffset;现在均改为srcRowsOffset * dim0stride,使得每个 tensor 的源地址偏移都基于其自身的dim0stride计算。 -
代码格式化调整:对
CopyInNoSplitDim1、ComputeNoSplitDim1Copy、ComputeSplitDim1Copy、CopyInSingleTensor、SetCopyInparam等函数的声明和调用进行了换行与缩进统一,无行为变更。


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 |
|---|---|---|
| ** | ✅ gcw_kUomxQ2l, wangrui_ (2/2) | ✅ gcw_kUomxQ2l (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)


compile


流水线任务触发成功
任务链接 [6e90f5b38c0d42c1a4ee56cb83d07ce8][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_harmony-infer | ✅ SUCCESS | >>>>> | |
| Compile_X86_monitor_910b | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910c | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_harmony-infer-chs-math | ✅ SUCCESS | >>>>> | |
| Compile_kirin-harmony-infer-chs-math-1 | ✅ SUCCESS | >>>>> | |
| UT_Test | ✅ SUCCESS | ||
| UT_Test_experimental | ✅ SUCCESS | ||
| UT_Test_kernel | ✅ SUCCESS | ||
| PreSmoke_A900 | ✅ SUCCESS | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> |
[2026-07-07 19:41:28] CI执行结束


流水线任务触发成功
任务链接 [a8bd0ac117b9411f81e60693f8409ac6][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_Pr | ✅ SUCCESS | ||
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_codestyle | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ⚠️ WARNING | >>>>> | >>>>> |
[2026-07-07 19:37:48] CI执行结束


/approve


The following users do not have permission to comment /lgtm or /approve on any module in this PR:
wangrui_


描述
关联的Issue
#2173
测试
完成冒烟、白盒、泛化用例测试
文档更新
不涉及
类型标签