已合并
cleancode for nonzero #2130
biabu创建于 2月27日
cleancode for nonzero #2130
已合并
biabu创建于 2月27日
已删除 :master合入到cann/ops-nnmaster
biabu
biabu成员
2月27日

描述

清理nonzero算子cleancode

关联的Issue

https://gitcode.com/cann/ops-nn/issues/1199

测试

文档更新

不涉及

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 biabu 的贡献)
biabubiabu成员
2月27日 创建了 pull request,commit 6008c6d6
CANN-robot
CANN-robot成员
2月27日 评论:

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
index zhou-qilong, wangyongguang (2/2) zhou-qilong, wangyongguang (2/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)
likedislike
CANN-robotCANN-robot成员
2月27日 添加了label:cann-cla/yes
CANN-robotCANN-robot成员
2月27日 将FelixTang7,crystalhu,fanqirui,zhou-qilong,chenqi317,liubo75,tangweiwei2,wangyongguang,zhang-wu设为评审人
CANN-robotCANN-robot成员
2月27日 将FelixTang7,crystalhu,zhou-qilong,chenqi317,liubo75,tangweiwei2,wangyongguang,zhang-wu设为审查人
CANN-robot
CANN-robot成员
2月27日 评论:

CLA Signature Pass

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

likedislike
CANN-robot
CANN-robot成员
2月27日 评论:

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

likedislike
CANN-robot
CANN-robot成员
2月27日 评论:

问题/功能描述

本次PR旨在优化非零元素索引计算内核的代码质量,主要解决底层代码中存在“魔术数字”硬编码的问题。通过将硬编码的队列缓冲区大小替换为具名常量,提升了代码的可读性和可维护性,为后续统一调整缓冲区配置提供了便利。

修改方案描述

修改方案的核心是在常量定义区域新增了一个名为 DB_BUFFER 的常量,并将其值设为2。随后,将 TQueBind 模板实例化时使用的队列缓冲区大小参数从硬编码的 2 替换为该常量。此修改属于纯粹的重构优化,未改变任何程序逻辑,仅通过引入具名常量消除了魔术数字,使代码意图更清晰,未来调整缓冲区大小时只需修改一处定义。

likedislike
biabu
biabu成员
2月27日 评论:

compile

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

流水线任务触发成功 [流水线指导]
任务链接 [4c52752719cf441883d4afd51c85b317]

任务名称状态日志下载链接
codecheck ✅ SUCCESS >>>>>
anti_virus ✅ SUCCESS >>>>>
Check_Pr ✅ SUCCESS >>>>>
Compile_Ascend_X86 ✅ 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 >>>>>
UT_Test_ophost ✅ SUCCESS
UT_Test_opapi ✅ SUCCESS
UT_Test_kernel ✅ SUCCESS
UT_Test_opgraph ✅ SUCCESS
Smoke_A900_npupool ✅ SUCCESS >>>>>

[2026-02-27 11:37:28]    CI执行结束

likedislike
biabubiabu成员
2月27日 修改了pull request 的描述
biabubiabu成员
2月27日 修改了pull request 的描述
biabubiabu成员
2月27日 修改了pull request 的描述
CANN-robotCANN-robot成员
2月27日 添加了label:api-check-pass
CANN-robotCANN-robot成员
2月27日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
2月27日 添加了label:ci-pipeline-passed
sunday成员
2月27日 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
2月27日 添加了label:approved
wangyongguang成员
2月27日 评论:

/approve

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

Review Guide

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

likedislike
CANN-robotCANN-robot成员
2月27日 合入了pull request