Pull Request已成功合入, 合并人@CANN-robot
(感谢 liuhongpeng 的贡献)变更摘要
本 PR 修复了 AdaptiveMaxPool3d 算子示例用例 test_aclnn_adaptive_max_pool3d.cpp 在 bash build.sh --run_example adaptive_max_pool3d eager --soc=ascend950 场景下的执行失败问题。核心原因是示例中输出缓冲与 indices 结果的数据类型和大小定义与算子实际输出不一致:将输出缓冲从固定 4 个元素调整为与输出 shape 匹配的 8 个元素,并将 indices 结果的数据类型从 int64_t 修正为与 ACL_INT32 张量一致的 int32_t,同时补充了对 indices 结果的打印,便于核对输出。
主要改动
- 修正输出缓冲大小: 将
outHostData与indicesHostData由固定 4 个元素的初始化列表改为std::vector<float> outHostData(8, 0)和std::vector<int32_t> indicesHostData(8, 0),使 host 侧缓冲大小与输出 shape 一致,避免因缓冲不足导致的失败。 - 修正
indices数据类型: 将拷贝结果用的indicesData从std::vector<int64_t>改为std::vector<int32_t>,并将aclrtMemcpy的拷贝长度由size * sizeof(int64_t)改为size * sizeof(int32_t),与以aclDataType::ACL_INT32创建的indices张量保持一致。 - 补充
indices结果打印: 新增遍历indicesData并打印indices[%ld] is: %d的循环,便于验证算子输出。 - 清理注释与文件结尾: 统一注释中
//创建与// 创建的格式,并在文件末尾补充换行符。


compile


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


流水线任务触发成功
任务链接 [c84ad264040d43f2947c22107e90a136][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Pre | ✅ SUCCESS | >>>>> | |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_950_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_950_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910b | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910c | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_classify | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_mobile_station_9030_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| UT_Test_ophost | ✅ SUCCESS | ||
| UT_Test_opapi | ✅ SUCCESS | ||
| UT_Test_kernel | ✅ SUCCESS | ||
| UT_Test_opgraph | ✅ SUCCESS | ||
| PreSmoke_A900 | ✅ SUCCESS | >>>>> | |
| API_Check | ✅ SUCCESS | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> | |
| UT_Test_report_lcov | ⚠️ WARNING | >>>>> |
[2026-08-21 18:22:19] CI执行结束


流水线任务触发成功
任务链接 [5ff3b3e0f72e48c0bb0bd2b7ba952066][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_checkpr | ✅ SUCCESS | ||
| StaticCheck_codespell | ✅ SUCCESS | ||
| StaticCheck_link_validity | ✅ SUCCESS | ||
| StaticCheck_resource_existence | ✅ SUCCESS | ||
| StaticCheck_tag_closed | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_precommit | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> |
[2026-08-21 18:13:03] CI执行结束


您好,pr合入已准备就绪,请尽快联系committer进行检视,谢谢!


/approve


/lgtm
/approve


描述
在环境中执行bash build.sh --run_example adaptive_max_pool3d eager --soc=ascend950报错
关联的Issue
https://gitcode.com/cann/ops-nn/issues/4998
测试
在环境中执行bash build.sh --run_example adaptive_max_pool3d eager --soc=ascend950,用例执行OK.
文档更新
类型标签
AI/Agent生成声明