已合并
isClose的示例中的输出类型不匹配 #4497
季骏创建于 18 天前
isClose的示例中的输出类型不匹配 #4497
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 季骏 的贡献)atomgit-bot
18 天前 评论:
18 天前 评论:
变更摘要
此 PR 修复了 aclnnIsClose 示例代码中输出变量类型与 API 实际输出类型不匹配的问题。isClose 的输出应为布尔型(uint8_t),但示例中错误地使用了 float 类型来接收结果和打印,导致类型不一致。同时更新了对应的文档说明。
主要改动
test_aclnn_isclose.cpp输出缓冲区类型修正: 将resultData的类型从std::vector<float>改为std::vector<uint8_t>,使输出缓冲区类型与isCloseAPI 返回的布尔结果类型一致。aclrtMemcpy拷贝大小计算修正: 将硬编码的size * sizeof(float)改为size * sizeof(resultData[0]),确保拷贝字节数自动跟随resultData的元素类型变化,消除手动维护类型一致性带来的风险。- 结果打印格式修正: 将
LOG_PRINT中的格式化占位符从%f(浮点)改为%d(整数),匹配uint8_t类型的实际输出。


atomgit-bot
18 天前 评论:
18 天前 评论:
18 天前 添加了label:cann-cla/yes
CANN-robot
18 天前 评论:
18 天前 评论:
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 |
|---|---|---|
| */*/docs/acl*.md | ✅ 汤平川, 陈娇 (2/2) | ✅ 陈娇 (1/1) |
| math/is_close | ✅ 汤平川, 宋恺 (2/2) | ✅ 汤平川, 宋恺 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
ji-jun1, thanks for your pull request. All authors of the commits have signed the CLA. 👍


此处折叠了48条消息 查看更多
TangPC
15 天前 评论:
15 天前 评论:
/lgtm
/approve


CANN-robot
15 天前 评论:
15 天前 评论:
The following users do not have permission to comment /lgtm or /approve on any module in this PR:
苏跃明


15 天前 添加了label:lgtm
15 天前 关闭了关联的issue
15 天前 合入了pull request
描述
isClose的aclnn demo中,存在变量申请的类型和使用的类型不匹配的问题
关联的Issue
#2543
测试
已测试通过
文档更新
math/is_close/docs/aclnnIsClose.md
类型标签