已合并
修改aclnnAddN代码告警 #3357
修改aclnnAddN代码告警 #3357
已合并
fitZepHYr创建于 6月16日
2 个文件变更+6-5
Mmath/add_n/op_api/add_n.cpp+5-5
@@ -64,18 +64,18 @@ static inline const aclTensor *AddNAiCpu(const aclTensorList *tensors, aclTensor
64 return out;64 return out;
65}65}
66 66 
67-const aclTensor *AddN(const aclTensorList *self, aclOpExecutor *executor)67+const aclTensor *AddN(const aclTensorList *tensors, aclOpExecutor *executor)
68{68{
69- auto out = executor->AllocTensor((*self)[0]->GetViewShape(), (*self)[0]->GetDataType());69+ auto out = executor->AllocTensor((*tensors)[0]->GetViewShape(), (*tensors)[0]->GetDataType());
70 if (out == nullptr) {70 if (out == nullptr) {
71 OP_LOGE(ACLNN_ERR_INNER_NULLPTR, "Alloc out tensor failed.");71 OP_LOGE(ACLNN_ERR_INNER_NULLPTR, "Alloc out tensor failed.");
72 return nullptr;72 return nullptr;
73 }73 }
74 74 
75- if (IsAiCoreSupport(self)) {75+ if (IsAiCoreSupport(tensors)) {
76- return AddNAiCore(self, out, executor);76+ return AddNAiCore(tensors, out, executor);
77 } else {77 } else {
78- return AddNAiCpu(self, out, executor);78+ return AddNAiCpu(tensors, out, executor);
79 }79 }
80}80}
81 81 
Mmath/add_n/tests/st/aclnnAddN/executor_aclnnAddN.py+1-0
@@ -1,3 +1,4 @@
1+# -*- coding: utf-8 -*-
1# Copyright (c) 2026 Huawei Technologies Co., Ltd.2# Copyright (c) 2026 Huawei Technologies Co., Ltd.
2# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of
3# CANN Open Software License Agreement Version 2.0 (the "License").4# CANN Open Software License Agreement Version 2.0 (the "License").