From f24d267439969d65d9c8c2d78a2d7fe2595ecdcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=B6=9B?= Date: Thu, 21 Nov 2024 07:50:15 +0000 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!5742=20?= =?UTF-8?q?:=20bugfix:=20fix=20error=20log'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- graph/utils/op_desc_utils_ex.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/graph/utils/op_desc_utils_ex.cc b/graph/utils/op_desc_utils_ex.cc index 9e32c61b1e..194ce1c21f 100644 --- a/graph/utils/op_desc_utils_ex.cc +++ b/graph/utils/op_desc_utils_ex.cc @@ -42,7 +42,7 @@ bool EnableFastIgnoreInferError() { char env_value[MMPA_MAX_PATH]; INT32 ret = mmGetEnv(fast_ignore_infer_error_env_name.c_str(), env_value, MMPA_MAX_PATH); GE_WARN_ASSERT(ret == EN_OK, - "Can not get FAST_IGNORE_INFER_ERROR environment variables. Disable fast ignore infer validation."); + "Can not get FAST_IGNORE_INFER_ERROR environment variables. Disable fast ignore infer error."); std::string env_str_value = std::string(env_value); GELOGI("The value of env[%s] is [%s].", fast_ignore_infer_error_env_name.c_str(), env_str_value.c_str()); return !env_str_value.empty(); @@ -109,10 +109,9 @@ graphStatus OpDescUtilsEx::CallInferFuncV1(const OpDescPtr &op_desc, Operator &o graphStatus OpDescUtilsEx::CallInferFunc(const OpDescPtr &op_desc, Operator &op) { GE_CHECK_NOTNULL(op_desc, ", Op is null for Infer Shape."); graphStatus ret; - // NoOp\cmo算子有原型,无infershape, 无数据输出, 此类需要跳过infer - const bool has_outputs = (op_desc->GetOutputsSize() != 0U); - const bool need_infer = - (has_outputs && (OperatorFactory::IsExistOp(op_desc->GetTypePtr()) || op_desc->GetInferFunc())); + // NoOp算子有原型,无infershape, 无数据输入输出, 此类需要跳过infer + const bool has_io = (op_desc->GetInputsSize() != 0U || op_desc->GetOutputsSize() != 0U); + const bool need_infer = (has_io && (OperatorFactory::IsExistOp(op_desc->GetTypePtr()) || op_desc->GetInferFunc())); if (!need_infer) { // todo 这是一个特殊错误码,早期版本与接口调用方约定的错误码,调用方认为这不是个错误,并且会依据该错误码作额外工作 // 如,映射到已有的IR上等行为,或无痛地跳过infershape(如netoutput/framework -- Gitee