Pull Request已成功合入, 合并人@ascend-robot
(感谢 cuiduo 的贡献)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-Ascend/op-plugin | ✅ liangsongwei, renyujin, wangmin0104, chuboning, wanglijun55 (5/2) | ✅ renyujin (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)


compile


问题/功能描述
修复了在非NPU设备(如CPU)上执行 ones_like 操作时,因调用自定义填充函数导致行为不一致的问题。该问题可能导致在特定设备上生成全1张量时出现异常或性能不佳。本次修改同时新增了针对CPU设备路径的单元测试,以验证修复的正确性。
修改方案描述
统一了非NPU设备(如CPU)上填充标量值 1 的实现方式。将两个内核实现文件中调用自定义 fill_ 函数(acl_op::fill_ 或 op_api::fill_)的代码,统一改为直接调用PyTorch标准张量成员函数 result.fill_(1)。这一修改确保了API的一致性并简化了代码路径。此外,在测试文件中补充了 test_ones_cpu_cases 测试用例,专门验证NPU和CPU路径在CPU设备上输出结果的一致性。


| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | Build_master_x86_USE_CXX_ABI_GCC13 | ✅ | >>> |
| Build_v2.6.0_x86 | ✅ | >>> | |
| Build_v2.7.1_x86 | ✅ | >>> | |
| Build_v2.8.0_x86 | ✅ | >>> | |
| Build_v2.9.0_x86 | ✅ | >>> | |
| Build_v2.10.0_x86 | ✅ | >>> | |
| Build_master_ARM_USE_CXX_ABI_GCC13 | ✅ | >>> | |
| Build_v2.6.0_ARM_USE_CXX_ABI | ✅ | >>> | |
| Build_v2.7.1_ARM | ✅ | >>> | |
| Build_v2.8.0_ARM | ✅ | >>> | |
| Build_v2.9.0_ARM | ✅ | >>> | |
| Build_v2.10.0_ARM | ✅ | >>> | |
| 恶意代码检查 | Antipoison | ✅ | >>> |
| 编码安全与规范检查 | CodeCheck | ✅ | >>> |
| 开源片段检查 | SCA | ✅ | >>> |
| 开发者测试 | UT_master_x86 | ✅ | >>> |
| UT_v2.6.0_x86 | ✅ | >>> | |
| UT_v2.7.1_x86 | ✅ | >>> | |
| UT_v2.8.0_x86 | ✅ | >>> | |
| UT_v2.9.0_x86 | ✅ | >>> | |
| UT_v2.10.0_x86 | ✅ | >>> | |
| UT_v2.7.1_ARM_A2 | ✅ | >>> | |
| 流水线 | PR-pipeline_op-plugin | ✅ | >>> |


/lgtm


/lgtm


/lgtm


Review Guide
This pull-request passes review.
Committers who wrote a comment of /approve are: renyujin.
Reviewers who wrote a comment of /lgtm are: liangsongwei, renyujin, wangmin0104, chuboning, wanglijun55.


【合入来源】
【修改方案】
【资料变更】
【接口变更】
【功能验证】
【CheckList】