已合并
scatter_update和scatter_elements_v2cleancode处理。 #2742
xiaodong666创建于 3月16日
scatter_update和scatter_elements_v2cleancode处理。 #2742
已合并
xiaodong666创建于 3月16日
xiaodong666成员
3月16日

描述

scatter_update和scatter_elements_v2cleancode处理。
告警扫描中仅包含david文件。

关联的Issue

Issue #1430

测试

st验证

文档更新

NA

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 xiaodong666 的贡献)
Xxiaodong666成员
3月16日 创建了 pull request,commit 2a3bc009
Xxiaodong666成员
3月16日 关联了issue:[Bug-Report|缺陷反馈]: aclnnIndexCopy部分空指针未校验导致多线程调用时报错
CANN-robot
CANN-robot成员
3月16日 评论:

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 chenqi317, fanqirui (2/2) chenqi317 (1/1)
repo-cann/ops-nn chenqi317, fanqirui (2/2) chenqi317 (1/1)

💡 Tip:

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

CLA Signature Pass

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

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

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

likedislike
xiaodong666成员
3月16日 评论:

/check-pr

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

The following labels are not ready.

lgtm: Please wait for reviewers to review the code.

approved: Please wait for committers to review the code.

ci-pipeline-passed: Please wait for the CI test to be completed.

likedislike
Xxiaodong666成员
3月16日 virtual merging failed, update merge request[project_id: 7665709, iid: 2742, target_commit_sha: ec588ab783dddea4a64ac47e5f1da1048d44a72f], message: Conflict detected
Xxiaodong666成员
3月16日 强制推送  1 个提交:c8411dfb-增加空指针校验。
Xxiaodong666成员
3月16日 virtual merging failed, update merge request[project_id: 7665709, iid: 2742, target_commit_sha: ec588ab783dddea4a64ac47e5f1da1048d44a72f], message: Conflict detected
CANN-robot
CANN-robot成员
3月16日 评论:

问题/功能描述

本次PR旨在重构 index_copy 算子的工作空间大小计算函数,以提升代码的可读性和可维护性。原实现中,处理输入张量连续化、维度重塑和维度参数标准化的逻辑分散且内联在主函数中,导致代码冗长且不易维护。重构的核心目标是将这些分散的逻辑模块化。

修改方案描述

方案通过引入一个名为 ContiguousAndReshapeParams 的静态辅助函数来实现重构。该函数集中处理了输入张量的连续化操作、标量输入的维度重塑逻辑以及维度参数的标准化。主函数 ExecIndexCopyGetWorkspaceSize 因此得以大幅简化,仅需调用此辅助函数。同时,将部分错误检查从 CHECK_RET 宏更新为更详细的 OP_CHECK 宏,以增强错误信息的可读性,并保持了原有的安全校验机制。

likedislike
Xxiaodong666成员
3月16日 update merge request[project id: 7665709, iid: 2742, commit_id: 77bb8119334641ddff67005ff849497820b572e1] virtual merging success
Xxiaodong666成员
3月16日 强制推送  129 个提交:ec588ab7-128 commits from branch 9.0.07bf9da67-增加空指针校验。
Xxiaodong666成员
3月16日 update merge request[project id: 7665709, iid: 2742, commit_id: 11fc9f1a75759b3289ff029285f8c551f983b5cc] virtual merging success
CANN-robotCANN-robot成员
3月16日 将fanqirui设为审查人
CANN-robot
CANN-robot成员
3月16日 评论:

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

likedislike
Xxiaodong666成员
3月16日 update merge request[project id: 7665709, iid: 2742, commit_id: fe00441363c58602a40b1097ad1439ba860b157c] virtual merging success
Xxiaodong666成员
3月16日 强制推送  1 个提交:e131c7c2-增加空指针校验。
Xxiaodong666成员
3月16日 update merge request[project id: 7665709, iid: 2742, commit_id: 3672da4a2e6c634fef17290046be9c0170bf4dc9] virtual merging success
CANN-robot
CANN-robot成员
3月16日 评论:

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

likedislike
Xxiaodong666成员
3月16日 修改了pull request 的描述
xiaodong666成员
3月16日 评论:

compile

likedislike
xiaodong666成员
3月16日 评论:

/check-pr

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

The following labels are not ready.

lgtm: Please wait for reviewers to review the code.

approved: Please wait for committers to review the code.

ci-pipeline-passed: Please wait for the CI test to be completed.

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

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

任务名称状态日志下载链接
解析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-16 12:12:06]    CI执行结束

likedislike
Xxiaodong666成员
3月16日 修改标题为 “cleancode处理。”,原标题为“增加空指针校验。”
CANN-robotCANN-robot成员
3月16日 添加了label:api-check-pass
CANN-robotCANN-robot成员
3月16日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
3月16日 添加了label:ci-pipeline-passed
范其瑞
范其瑞成员
3月16日 评论:

/lgtm

likedislike
chenqi317成员
3月16日 评论:

/lgtm
/approve

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

Review Guide

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

likedislike
CANN-robotCANN-robot成员
3月16日 合入了pull request
Xxiaodong666成员
3月16日 修改标题为 “scatter_update和scatter_elements_v2cleancode处理。”,原标题为“cleancode处理。”
Xxiaodong666成员
3月16日 修改了pull request 的描述