已合并
aclnn_convolution进行cleancode修改,消除magic number #2868
wanyukang创建于 3月18日
aclnn_convolution进行cleancode修改,消除magic number #2868
已合并
wanyukang创建于 3月18日
wanyukang
wanyukang
3月18日

描述

消除magic number

关联的Issue

测试

文档更新

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 wanyukang 的贡献)
wanyukangwanyukang
3月18日 创建了 pull request,commit aa73256e
CANN-robot
CANN-robot成员
3月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
conv ✅ crystalhu, zhangyuxiang0119 (2/2) ✅ crystalhu, zhangyuxiang0119 (2/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

wanyukang, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
CANN-robotCANN-robot成员
3月18日 添加了label:cann-cla/yes
CANN-robotCANN-robot成员
3月18日 将crystalhu,fanqirui,zhou-qilong,chenqi317,lileizheng,liubo75,tangweiwei2,zhangyuxiang0119,zhang-wu设为评审人
CANN-robotCANN-robot成员
3月18日 将crystalhu,chenqi317,lileizheng,liubo75,tangweiwei2,zhangyuxiang0119,zhang-wu设为审查人
CANN-robot
CANN-robot成员
3月18日 评论:

🔵 source code change are detected, tasks labels is removed in this pull request!

likedislike
wanyukangwanyukang
3月18日 修改标题为 “aclnn_convolution进行cleancode修改,消除magic number”,原标题为“cleancode修改,消除magic number”
wanyukang
wanyukang
3月18日 评论:

compile

likedislike
CANN-robot
CANN-robot成员
3月18日 评论:

问题/功能描述

本次PR对卷积算子(Convolution)的白名单判断逻辑进行了代码优化。主要解决了原代码在判断卷积2D场景是否为白名单用例时,对步长(stride)数组维度使用了硬编码数字“2”进行检查的问题,提升了代码的可读性和可维护性。

修改方案描述

修改方案将原硬编码判断替换为使用已定义的常量 STRIDE_WHITE_LIST_SIZE。具体在文件头部定义了该常量(值为2),并在 IsConv2DWhiteListCase 函数中使用此常量进行步长数组大小的判断。此修改不改变原有功能逻辑,属于纯粹的重构优化。

likedislike
CANN-robotCANN-robot成员
3月18日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
3月18日 评论:

流水线任务触发成功
任务链接 [70ca65cf7586479892861ca75d8d99e9][流水线指导]

任务名称状态日志下载链接
解析CI分支 ✅ SUCCESS
codecheck ✅ SUCCESS >>>>>
anti_virus ✅ SUCCESS >>>>>
Check_Pr ✅ SUCCESS >>>>>
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 >>>>> >>>>>
API_Check ✅ SUCCESS >>>>>
Pre_Compile ✅ SUCCESS
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_950_ubuntu24 ✅ SUCCESS >>>>>
StaticCheck_codespell_check ✅ SUCCESS
StaticCheck_link_validity_check ✅ SUCCESS
StaticCheck_resource_existence_check ✅ SUCCESS
StaticCheck_tag_closed_check ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_single_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_experimental_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM_950_ubuntu24 ✅ SUCCESS >>>>>
UT_Test_ophost ✅ SUCCESS
UT_Test_opapi ✅ SUCCESS
UT_Test_kernel ✅ SUCCESS
UT_Test_opgraph ✅ SUCCESS
Smoke_A900_npupool ✅ SUCCESS >>>>>

[2026-03-18 15:27:03]    CI执行结束

likedislike
CANN-robotCANN-robot成员
3月18日 添加了label:api-check-pass
CANN-robotCANN-robot成员
3月18日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
3月18日 添加了label:ci-pipeline-passed
胡碧霞成员
3月18日 评论:

/approve

likedislike
CANN-robotCANN-robot成员
3月18日 添加了label:approved
张喻翔
张喻翔
3月18日 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
3月18日 添加了label:lgtm
CANN-robot
CANN-robot成员
3月18日 评论:

Review Guide

This pull-request passes review.
Committers who wrote a comment of /approve are: crystalhu, zhangyuxiang0119.
Reviewers who wrote a comment of /lgtm are: crystalhu, zhangyuxiang0119.

likedislike
CANN-robotCANN-robot成员
3月18日 合入了pull request
wanyukangwanyukang
3月18日 关联了issue:[Bug-Report|缺陷反馈]: 代码中有magic number