已合并
fix: 修复 GRU 与 GRU 反向算子 aclnn 接口的编码规范告警 #9180
Nice try创建于 15 天前
fix: 修复 GRU 与 GRU 反向算子 aclnn 接口的编码规范告警 #9180
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 Nice try 的贡献)atomgit-bot
15 天前 评论:
15 天前 评论:
变更摘要
本 PR 主要针对 GRU 算子的 aclnn_gru.cpp 与 aclnn_gru_backward.cpp 进行代码规范(cleancode)修复,不涉及业务逻辑改动:通过 [[maybe_unused]] 标注未使用的参数/函数消除编译告警,通过显式 static_cast<int64_t> 统一形状计算中的类型转换,并修正日志输出中的格式说明符使其与实参类型匹配。
主要改动
- 未使用参数标注: 在
aclnn_gru.cpp的CheckNotNull、CheckDimsSize中对未实际使用的hx参数添加[[maybe_unused]]修饰,并将GruDataGetWorkspaceSize函数声明为[[maybe_unused]],用于消除编译告警 - 形状计算显式类型转换: 在
CheckShape中,将expHxShape、expOutputShape、expHyShape内涉及dScale(uint64_t)的运算显式转换为static_cast<int64_t>,使类型一致 - 维度比较与日志格式修正: 在
aclnn_gru_backward.cpp的ValidateShape中移除多余的static_cast<int64_t>比较,并将OP_LOGE中描述维度的格式说明符由%u改为%zu,与GetDimNum()的实际返回类型匹配


不准确?
atomgit-bot
15 天前 评论:
15 天前 评论:
15 天前 添加了label:cann-cla/yes
CANN-robot
15 天前 评论:
15 天前 评论:
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 |
|---|---|---|
| rnn | ✅ 汤平川, 钱泽洪 (2/2) | ✅ 汤平川, 钱泽洪 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)


CANN-robot
15 天前 评论:
15 天前 评论:
15 天前 将zengjuan,chaotang233,kevin_huang1234,crystalhu,yangyang016,fanqirui,su-yueming,chenqi317,wang-xing001,liubo75,tangweiwei2,pingchuantang,qianzehong,liuchuangdev设为评审人
15 天前 将zengjuan,chaotang233,kevin_huang1234,crystalhu,yangyang016,fanqirui,su-yueming,chenqi317,wang-xing001,liubo75,tangweiwei2,pingchuantang,qianzehong,liuchuangdev设为评审人
15 天前 将kevin_huang1234,su-yueming,wang-xing001,pingchuantang,qianzehong,liuchuangdev设为审查人
15 天前 修改标题为 “fix: 修复 GRU 与 GRU 反向算子 aclnn 接口的编码规范告警”,原标题为“fix cleancode problem”
15 天前 修改了pull request 的描述
Nice try
15 天前 评论:
15 天前 评论:
compile


15 天前 update merge request[project id: 7665709, iid: 9180, commit_id: e53311aee94fa85bcaffb4be56e3728e1178785e] virtual merging success
15 天前 update merge request[project id: 7665709, iid: 9180, commit_id: e53311aee94fa85bcaffb4be56e3728e1178785e] virtual merging success
15 天前 添加了label:ci-pipeline-running
CANN-robot
15 天前 评论:
15 天前 评论:
流水线任务触发成功
任务链接 [cb6cad3a8cea46589f33fcd3c99b3afd][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 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-25 16:16:41] CI执行结束


CANN-robot
15 天前 评论:
15 天前 评论:
流水线任务触发成功
任务链接 [a1cbd170da09434e9a7f564d90439c9a][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 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-25 16:06:55] CI执行结束


15 天前 添加了label:api-check-pass
15 天前 删除了label:ci-pipeline-running
15 天前 添加了label:ci-pipeline-passed
qianzehong
15 天前 评论:
15 天前 评论:
/approve


15 天前 添加了label:approved
TangPC
15 天前 评论:
15 天前 评论:
/lgtm
/approve


15 天前 添加了label:lgtm
15 天前 关闭了关联的issue
15 天前 合入了pull request
描述
修复 GRU 算子(rnn/gru/op_api/aclnn_gru.cpp)与 GRU 反向算子(rnn/gru_grad/op_api/aclnn_gru_backward.cpp)aclNN 接口的编码规范(cleancode)告警:
关联的Issue
关联 Issue https://gitcode.com/cann/ops-nn/issues/5129
测试
通过编码规范(cleancode)检查。
文档更新
无。
类型标签
AI/Agent生成声明