Browse Source

!1695 clean sc warning of graphengine

From: @zhou_lili
Reviewed-by: @youui,@wqtshg
Signed-off-by:
tags/v1.3.0
mindspore-ci-bot Gitee 4 years ago
parent
commit
9971cc96c5
34 changed files with 99 additions and 101 deletions
  1. +7
    -7
      ge/client/ge_api.cc
  2. +4
    -4
      ge/common/dump/dump_op.cc
  3. +3
    -4
      ge/common/formats/format_transfers/format_transfer_fracz_nchw.cc
  4. +5
    -8
      ge/common/formats/format_transfers/format_transfer_fracz_nhwc.cc
  5. +4
    -5
      ge/common/formats/format_transfers/format_transfer_hwcn_c1hwncoc0.cc
  6. +1
    -1
      ge/common/formats/formats.cc
  7. +10
    -9
      ge/common/helper/model_helper.cc
  8. +6
    -7
      ge/common/op/ge_op_utils.cc
  9. +2
    -2
      ge/engine_manager/dnnengine_manager.cc
  10. +2
    -1
      ge/graph/build/memory/graph_mem_assigner.cc
  11. +2
    -1
      ge/graph/build/model_builder.cc
  12. +1
    -1
      ge/graph/execute/graph_execute.cc
  13. +1
    -1
      ge/graph/manager/graph_var_manager.cc
  14. +2
    -1
      ge/graph/manager/util/hcom_util.cc
  15. +1
    -1
      ge/graph/passes/atomic_addr_clean_pass.cc
  16. +2
    -1
      ge/graph/passes/attach_stream_label_pass.cc
  17. +1
    -1
      ge/graph/passes/bitcast_pass.cc
  18. +1
    -1
      ge/graph/passes/cond_pass.cc
  19. +2
    -2
      ge/graph/passes/ctrl_edge_transfer_pass.cc
  20. +7
    -7
      ge/graph/passes/hccl_memcpy_pass.cc
  21. +0
    -2
      ge/graph/passes/inplace_support_check_pass.cc
  22. +1
    -1
      ge/graph/passes/mark_graph_unknown_status_pass.cc
  23. +1
    -1
      ge/graph/passes/multi_batch_clone_pass.cc
  24. +1
    -1
      ge/graph/passes/multi_batch_pass.cc
  25. +7
    -8
      ge/graph/passes/net_output_pass.cc
  26. +1
    -1
      ge/graph/passes/pass_utils.cc
  27. +1
    -1
      ge/graph/passes/switch_data_edges_bypass.cc
  28. +6
    -6
      ge/graph/passes/transop_without_reshape_fusion_pass.cc
  29. +4
    -4
      ge/graph/passes/variable_op_pass.cc
  30. +2
    -2
      ge/graph/preprocess/graph_preprocess.cc
  31. +2
    -2
      ge/graph/preprocess/multi_batch_copy_graph.cc
  32. +2
    -3
      ge/hybrid/node_executor/aicore/aicore_op_task.cc
  33. +1
    -1
      ge/hybrid/node_executor/rts/rts_task_factory.h
  34. +6
    -3
      ge/ir_build/option_utils.cc

+ 7
- 7
ge/client/ge_api.cc View File

@@ -69,10 +69,10 @@ Status CheckOptionsValid(const std::map<string, string> &options) {
auto job_id_iter = options.find(OPTION_EXEC_JOB_ID);
if (job_id_iter != options.end()) {
if (job_id_iter->second.length() > kMaxStrLen) {
GELOGE(PARAM_INVALID,"[Check][JobId]Failed,"
GELOGE(PARAM_INVALID, "[Check][JobId]Failed,"
"the job_id [%s] string length: %zu > max string length: %d",
job_id_iter->second.c_str(), job_id_iter->second.length(), kMaxStrLen);
REPORT_INPUT_ERROR("E10051", std::vector<std::string>({"id","length"}),
REPORT_INPUT_ERROR("E10051", std::vector<std::string>({"id", "length"}),
std::vector<std::string>({job_id_iter->second,
std::to_string(kMaxStrLen)}));
return FAILED;
@@ -244,7 +244,7 @@ std::string GEGetWarningMsg() {
// Initialize session,which calls innerSession
Session::Session(const std::map<string, string> &options) {
ErrorManager::GetInstance().SetStage(error_message::kInitialize, error_message::kOther);
GELOGT(TRACE_INIT, "Session Constructor start");
GELOGT(TRACE_INIT, "Start to construct session.");

ErrorManager::GetInstance().GenWorkStreamIdDefault();
// check init status
@@ -332,7 +332,7 @@ Session::Session(const std::map<AscendString, AscendString> &options) {
// session destructor
Session::~Session() {
ErrorManager::GetInstance().SetStage(error_message::kFinalize, error_message::kFinalize);
GELOGT(TRACE_INIT, "Session Destructor start");
GELOGT(TRACE_INIT, "Start to destruct session.");
// 0.check init status
if (!g_ge_initialized) {
GELOGW("GE is not yet initialized or is finalized.");
@@ -602,16 +602,16 @@ Status Session::RunGraph(uint32_t graph_id, const std::vector<Tensor> &inputs, s
Status Session::RunGraphWithStreamAsync(uint32_t graph_id, void *stream, const std::vector<Tensor> &inputs,
std::vector<Tensor> &outputs) {
ErrorManager::GetInstance().SetStage(error_message::kModelCompile, error_message::kOther);
GELOGT(TRACE_INIT, "Session run graph with stream async start");
GELOGT(TRACE_INIT, "Start to run graph with stream async.");

ErrorManager::GetInstance().GenWorkStreamIdBySessionGraph(sessionId_, graph_id);
std::shared_ptr<GELib> instance_ptr = ge::GELib::GetInstance();
if (instance_ptr == nullptr) {
GELOGE(GE_CLI_GE_NOT_INITIALIZED,
"[Run][Graph]Run graph with stream asyn failed, the GELib instance is nullptr,"
"[Run][Graph]Run graph with stream async failed, the GELib instance is nullptr,"
"session id = %lu, graph id = %u, stream = %p.", sessionId_, graph_id, stream);
REPORT_INNER_ERROR("E19999",
"Run graph with stream asyn failed, the GELib instance is nullptr"
"Run graph with stream async failed, the GELib instance is nullptr"
"session id = %lu, graph id = %u, stream = %p.", sessionId_, graph_id, stream);
return FAILED;
}


+ 4
- 4
ge/common/dump/dump_op.cc View File

@@ -66,21 +66,21 @@ void DumpOp::SetDynamicModelInfo(const string &dynamic_model_name, const string
static void SetOpMappingLoopAddr(uintptr_t step_id, uintptr_t loop_per_iter, uintptr_t loop_cond,
toolkit::aicpu::dump::OpMappingInfo &op_mapping_info) {
if (step_id != 0) {
GELOGI("step_id exists.");
GELOGI("Exists step_id.");
op_mapping_info.set_step_id_addr(static_cast<uint64_t>(step_id));
} else {
GELOGI("step_id is null.");
}

if (loop_per_iter != 0) {
GELOGI("loop_per_iter exists.");
GELOGI("Exists loop_per_iter.");
op_mapping_info.set_iterations_per_loop_addr(static_cast<uint64_t>(loop_per_iter));
} else {
GELOGI("loop_per_iter is null.");
}

if (loop_cond != 0) {
GELOGI("loop_cond exists.");
GELOGI("Exists loop_cond.");
op_mapping_info.set_loop_cond_addr(static_cast<uint64_t>(loop_cond));
} else {
GELOGI("loop_cond is null.");
@@ -253,7 +253,7 @@ Status DumpOp::LaunchDumpOp() {
}
if (device_id < 0) {
GELOGE(ACL_ERROR_GE_INTERNAL_ERROR, "[Check][DeviceId]Failed, device_id %d", device_id);
REPORT_INNER_ERROR("E19999","Check device_id %d failed", device_id);
REPORT_INNER_ERROR("E19999", "Check device_id %d failed", device_id);
return ACL_ERROR_GE_INTERNAL_ERROR;
}
toolkit::aicpu::dump::OpMappingInfo op_mapping_info;


+ 3
- 4
ge/common/formats/format_transfers/format_transfer_fracz_nchw.cc View File

@@ -72,8 +72,7 @@ Status CheckArgsForFracZToNchw(const TransArgs &args) {
if (src_shape.at(kFracZHWC1) != dst_shape.at(kNchwH) * dst_shape.at(kNchwW) * c1 ||
src_shape.at(kFracZC0) != c0 || src_shape.at(kFracZNi) != kNiSize || src_shape.at(kFracZN0) != n0) {
GELOGE(ACL_ERROR_GE_SHAPE_INVALID,
"[Check][Shape]Failed to check relationship between src and dst shape, "
"src shape %s, dst shape %s",
"[Check][Shape]Failed to check relationship between src and dst shape, src shape %s, dst shape %s",
ShapeToString(src_shape).c_str(), ShapeToString(dst_shape).c_str());
REPORT_INNER_ERROR("E19999", "Failed to check relationship between src and dst shape, "
"src shape %s, dst shape %s",
@@ -138,9 +137,9 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, const in
"[Operate][Memory]Failed to copy data from FracZ offset %ld to "
"NCHW[%ld, %ld, %ld, %ld] offset %ld, err-code %d",
src_offset, n_idx, c_idx, h_idx, w_idx, dst_offset, ret);
REPORT_CALL_ERROR("E19999","Failed to copy data from FracZ offset %ld to "
REPORT_CALL_ERROR("E19999", "Failed to copy data from FracZ offset %ld to "
"NCHW[%ld, %ld, %ld, %ld] offset %ld, err-code %d",
src_offset, n_idx, c_idx, h_idx, w_idx, dst_offset, ret );
src_offset, n_idx, c_idx, h_idx, w_idx, dst_offset, ret);
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED;
}
}


+ 5
- 8
ge/common/formats/format_transfers/format_transfer_fracz_nhwc.cc View File

@@ -44,23 +44,20 @@ Status CheckArgsForFracZToNhwc(const TransArgs &args) {
GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, "[Check][DataType]Failed, "
"shape from FORMAT_FRACTAL_Z to NCHW, invalid data type %s",
TypeUtils::DataTypeToSerialString(args.src_data_type).c_str());
REPORT_INNER_ERROR("E19999", "Failed to trans shape from FORMAT_FRACTAL_Z to NCHW, "
"invalid data type %s",
REPORT_INNER_ERROR("E19999", "Failed to trans shape from FORMAT_FRACTAL_Z to NCHW, invalid data type %s",
TypeUtils::DataTypeToSerialString(args.src_data_type).c_str());
return ACL_ERROR_GE_DATATYPE_INVALID;
}
if (!CheckShapeValid(src_shape, kFracZDimsNum)) {
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Value is invalid, src shape %s",
ShapeToString(src_shape).c_str());
REPORT_CALL_ERROR("E19999", "Src shape %s check invalid",
ShapeToString(src_shape).c_str());
REPORT_CALL_ERROR("E19999", "Src shape %s check invalid", ShapeToString(src_shape).c_str());
return ACL_ERROR_GE_SHAPE_INVALID;
}
if (!CheckShapeValid(dst_shape, kNhwcDimsNum)) {
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Value is invalid, dst shape %s",
ShapeToString(dst_shape).c_str());
REPORT_CALL_ERROR("E19999", "Dst shape %s check invalid",
ShapeToString(dst_shape).c_str());
REPORT_CALL_ERROR("E19999", "Dst shape %s check invalid", ShapeToString(dst_shape).c_str());
return ACL_ERROR_GE_SHAPE_INVALID;
}
int64_t c0 = GetCubeSizeByDataType(args.src_data_type);
@@ -138,7 +135,7 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, int size
"[Operate][Memory]Failed to copy data from FracZ offset %ld to "
"NCHW[%ld, %ld, %ld, %ld] offset %ld, err-code %d",
src_offset, n_idx, c_idx, h_idx, w_idx, dst_offset, ret);
REPORT_CALL_ERROR("E19999","Failed to copy data from FracZ offset %ld to "
REPORT_CALL_ERROR("E19999", "Failed to copy data from FracZ offset %ld to "
"NCHW[%ld, %ld, %ld, %ld] offset %ld, err-code %d",
src_offset, n_idx, c_idx, h_idx, w_idx, dst_offset, ret);
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED;
@@ -185,7 +182,7 @@ Status FormatTransferFracZNhwc::TransFormat(const TransArgs &args, TransResult &
ShapeToString(args.src_shape).c_str(),
TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(),
ShapeToString(args.dst_shape).c_str(), total_size, ret);
REPORT_CALL_ERROR("E19999","Failed to get data after trans, src shape %s, data type %s, "
REPORT_CALL_ERROR("E19999", "Failed to get data after trans, src shape %s, data type %s, "
"dst shape %s, memory size %ld, error_code %u",
ShapeToString(args.src_shape).c_str(),
TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(),


+ 4
- 5
ge/common/formats/format_transfers/format_transfer_hwcn_c1hwncoc0.cc View File

@@ -112,11 +112,10 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, const in
total_size, ShapeToString(args.dst_shape).c_str(),
TypeUtils::FormatToSerialString(args.src_format).c_str(),
TypeUtils::FormatToSerialString(args.dst_format).c_str());
REPORT_CALL_ERROR("E19999", "Failed to alloc the memory for dst buf %ld, "
"shape %s when trans format from %s to %s",
total_size, ShapeToString(args.dst_shape).c_str(),
TypeUtils::FormatToSerialString(args.src_format).c_str(),
TypeUtils::FormatToSerialString(args.dst_format).c_str());
REPORT_CALL_ERROR("E19999", "Failed to alloc the memory for dst buf %ld, shape %s when trans format from %s to %s",
total_size, ShapeToString(args.dst_shape).c_str(),
TypeUtils::FormatToSerialString(args.src_format).c_str(),
TypeUtils::FormatToSerialString(args.dst_format).c_str());
return ACL_ERROR_GE_MEMORY_ALLOCATION;
}



+ 1
- 1
ge/common/formats/formats.cc View File

@@ -47,7 +47,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Status TransFormat(const TransArg
GELOGE(ACL_ERROR_GE_PARAM_INVALID, "[Check][Shape]Failed, input data is null "
"or shape size not euqal to 0, src_shape %s",
ShapeToString(args.src_shape).c_str());
REPORT_CALL_ERROR("E19999","Failed to check shape, input data is null "
REPORT_CALL_ERROR("E19999", "Failed to check shape, input data is null "
"or shape size not equal to 0, src_shape %s",
ShapeToString(args.src_shape).c_str());
return ACL_ERROR_GE_PARAM_INVALID;


+ 10
- 9
ge/common/helper/model_helper.cc View File

@@ -79,7 +79,8 @@ Status ModelHelper::SaveModelPartition(std::shared_ptr<OmFileSaveHelper> &om_fil
Status ModelHelper::SaveSizeToModelDef(const GeModelPtr &ge_model) {
vector<int64_t> om_info;
auto ge_model_weight = ge_model->GetWeight();
GELOGD("SaveSizeToModelDef weight_data_size is %zu, %p", ge_model_weight.GetSize(), ge_model_weight.GetData());
GELOGD("SaveSizeToModelDef weight_data_size is %zu, ge_model_weight data is %p", ge_model_weight.GetSize(),
ge_model_weight.GetData());
om_info.push_back(ge_model_weight.GetSize());

TBEKernelStore tbe_kernel_store = ge_model->GetTBEKernelStore();
@@ -284,7 +285,7 @@ Status ModelHelper::SaveAllModelPartiton(std::shared_ptr<OmFileSaveHelper>& om_f
if (SaveModelWeights(om_file_save_helper, ge_model, model_index) != SUCCESS) {
GELOGE(FAILED, "[Save][ModelWeights]Failed, model %s, model index %zu",
ge_model->GetName().c_str(), model_index);
REPORT_CALL_ERROR("E19999","ModelHelper save mode weights failed, model %s, model index %zu",
REPORT_CALL_ERROR("E19999", "ModelHelper save mode weights failed, model %s, model index %zu",
ge_model->GetName().c_str(), model_index);
return FAILED;
}
@@ -441,7 +442,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::SaveToOmRoo
GELOGE(INTERNAL_ERROR, "[Save][AllModelPartition]Failed, model name %s, cur_index %zu",
model_name.c_str(), cur_index);
REPORT_CALL_ERROR("E19999", "Save all model %s partition failed, cur_index %zu",
model_name.c_str(), cur_index);
model_name.c_str(), cur_index);
return INTERNAL_ERROR;
}
}
@@ -459,7 +460,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::SaveToOmRoo
GELOGE(FAILED, "[Save][Model]OmFileSaveHelper save model eturn fail, output_file %s",
output_file.c_str());
REPORT_CALL_ERROR("E19999", "OmFileSaveHelper save model return fail, output_file %s",
output_file.c_str());
output_file.c_str());
return FAILED;
}
return SUCCESS;
@@ -601,7 +602,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::LoadModel(c
FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::LoadRootModel(const ge::ModelData &model_data) {
if (model_data.model_data == nullptr || model_data.model_len == 0) {
GELOGE(ACL_ERROR_GE_EXEC_MODEL_DATA_SIZE_INVALID, "[Load][RootModel] "
"Model_data is nullptr or model_data_size is 0");
"Model_data is nullptr or model data is empty.");
REPORT_INNER_ERROR("E19999", "Load root model failed, model_data is nullptr or its size is 0");
return ACL_ERROR_GE_EXEC_MODEL_DATA_SIZE_INVALID;
}
@@ -628,7 +629,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::LoadRootMod
//model verison 1.0 file header does not have model_num member
is_unknown_shape_model_ = file_header_->version >= ge::MODEL_VERSION &&
file_header_->model_num > kStatiOmFileModelNum;
GELOGD("cur om model is ge root model or no %d, model version %u", is_unknown_shape_model_, file_header_->version);
GELOGD("Cur om model is ge root model or no %d, model version %u", is_unknown_shape_model_, file_header_->version);

OmFileLoadHelper om_load_helper;
if (is_unknown_shape_model_) {
@@ -650,7 +651,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::LoadRootMod
GELOGE(status, "[Generate][GERootModel]Failed");
return status;
}
GELOGD("in ModelHelper::LoadRootModel, is_assign_model_ is setted to true!");
GELOGD("In ModelHelper::LoadRootModel, is_assign_model_ is setted to true!");
is_assign_model_ = true;
return SUCCESS;
}
@@ -790,7 +791,7 @@ Status ModelHelper::LoadWeights(OmFileLoadHelper &om_load_helper) {
if (om_load_helper.GetModelPartition(ModelPartitionType::WEIGHTS_DATA, partition) != SUCCESS) {
GELOGE(FAILED, "[Get][ModelWeightPartition]Failed, GetWeight size:%u", partition.size);
REPORT_CALL_ERROR("E19999", "[Get][ModelPartition]Failed, GetWeight size:%u",
partition.size);
partition.size);
return FAILED;
}
ge::Buffer weight = ge::Buffer::CopyFrom(partition.data, partition.size);
@@ -805,7 +806,7 @@ Status ModelHelper::LoadWeights(OmFileLoadHelper &om_load_helper, GeModelPtr &cu
if (om_load_helper.GetModelPartition(ModelPartitionType::WEIGHTS_DATA, partition, mode_index) != SUCCESS) {
GELOGE(FAILED, "[Get][ModelPartition]Failed, GetWeight size:%u", partition.size);
REPORT_CALL_ERROR("E19999", "[Get][ModelPartition]Failed, GetWeight size:%u",
partition.size);
partition.size);
return FAILED;
}
ge::Buffer weight = ge::Buffer::CopyFrom(partition.data, partition.size);


+ 6
- 7
ge/common/op/ge_op_utils.cc View File

@@ -444,17 +444,16 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status
OpUtils::GetShapeDataFromConstTensor(const ConstGeTensorPtr &tensor, DataType type, std::vector<int64_t> &dims) {
if (tensor == nullptr) {
GELOGE(PARAM_INVALID, "[Check][Param]Input tensor is nullptr");
REPORT_INNER_ERROR("E19999","Input tensor is nullptr");
REPORT_INNER_ERROR("E19999", "Input tensor is nullptr");
return PARAM_INVALID;
}

// If the tensor data is a vector, the shape dimension must be 1
if (tensor->GetTensorDesc().GetShape().GetDims().size() > 1) {
GELOGE(PARAM_INVALID, "[Check][Param]The dimension of the input tensor shape "
"cannot be more than 1, it is %zu",
GELOGE(PARAM_INVALID, "[Check][Param]The dimension of the input tensor shape cannot be more than 1, it is %zu",
tensor->GetTensorDesc().GetShape().GetDims().size());
REPORT_CALL_ERROR("E19999", "The dimension of the input tensor shape %zu invalid, "
"more than 1", tensor->GetTensorDesc().GetShape().GetDims().size());
REPORT_CALL_ERROR("E19999", "The dimension of the input tensor shape %zu invalid, more than 1",
tensor->GetTensorDesc().GetShape().GetDims().size());
return PARAM_INVALID;
}

@@ -473,8 +472,8 @@ OpUtils::GetShapeDataFromConstTensor(const ConstGeTensorPtr &tensor, DataType ty
dims.push_back(shape_data[i]);
}
} else {
GELOGE(PARAM_INVALID, "[Check][DataType]Invalid, type only can be DT_INT32 or DT_INT64, "
"type is %s", TypeUtils::DataTypeToSerialString(type).c_str());
GELOGE(PARAM_INVALID, "[Check][DataType]Invalid, type only can be DT_INT32 or DT_INT64, type is %s",
TypeUtils::DataTypeToSerialString(type).c_str());
REPORT_INNER_ERROR("E19999", "Data type %s check invalid, only can be DT_INT32 or DT_INT64",
TypeUtils::DataTypeToSerialString(type).c_str());
return PARAM_INVALID;


+ 2
- 2
ge/engine_manager/dnnengine_manager.cc View File

@@ -304,7 +304,7 @@ std::string DNNEngineManager::GetHostCpuEngineName(const std::vector<OpInfo> &op
GELOGE(FAILED, "[Get][HostCpuEngineName]Failed, HostCpuEngine not support [%s, %s]",
op_desc->GetName().c_str(), op_desc->GetType().c_str());
REPORT_INNER_ERROR("E19999", "Get HostCpuEngineName failed, HostCpuEngine not support [%s, %s]",
op_desc->GetName().c_str(), op_desc->GetType().c_str());
op_desc->GetName().c_str(), op_desc->GetType().c_str());
return "";
}

@@ -436,7 +436,7 @@ Status DNNEngineManager::ParserEngineMessage(const json engines_json, const std:
GELOGE(FAILED, "[Check][Param]There are the same engine %s message in the json file",
engine_id.c_str());
REPORT_INNER_ERROR("E19999", "There are the same engine %s message in the json file",
engine_id.c_str());
engine_id.c_str());
return FAILED;
}
engines.emplace(engine_id, engine_conf_ptr);


+ 2
- 1
ge/graph/build/memory/graph_mem_assigner.cc View File

@@ -684,7 +684,8 @@ Status GraphMemoryAssigner::AssignContinuousInputMemory(const ge::NodePtr &node,
bool is_allocated_first_input = is_continuous_input_allocated && (in_data_anchor->GetIdx() == 0);
if (is_allocated_first_input) {
std::map<int32_t, int32_t> out2ins;
GE_CHK_STATUS_RET(TryGetNodeRefIndexes(node, out2ins), "[Get][RefIndexes]fail for node: %s", node->GetName().c_str());
GE_CHK_STATUS_RET(TryGetNodeRefIndexes(node, out2ins), "[Get][RefIndexes]fail for node: %s",
node->GetName().c_str());
// output is beginning offset, set offset for input; only support this case now
if ((out2ins.size() == 1) && (out2ins.begin()->second == 0) && (reverse_refresh)) {
auto peer_output_offset = output_list.at(peer_out_data_anchor->GetIdx());


+ 2
- 1
ge/graph/build/model_builder.cc View File

@@ -246,7 +246,8 @@ Status ModelBuilder::SetInputOutputDesc() {
}
// if user set input node format ND, the expected node for data and netoutput format is ND in
// final graph.
if ((compute_graph_->GetParentGraph() == nullptr) && (GetLocalOmgContext().format == domi::DOMI_TENSOR_ND) && (!node_op_desc->HasAttr("_is_single_op")) &&
if ((compute_graph_->GetParentGraph() == nullptr) && (GetLocalOmgContext().format == domi::DOMI_TENSOR_ND) &&
(!node_op_desc->HasAttr("_is_single_op")) &&
((node_op_desc->GetType() == DATA_TYPE) || (node_op_desc->GetType() == NETOUTPUT))) {
auto inputDescsPtr = node_op_desc->GetAllInputsDescPtr();
auto outputDescsPtr = node_op_desc->GetAllOutputsDescPtr();


+ 1
- 1
ge/graph/execute/graph_execute.cc View File

@@ -704,7 +704,7 @@ Status GraphExecutor::GetCurShape(const uint32_t model_id, std::vector<int64_t>
}

Status GraphExecutor::GetOpAttr(uint32_t model_id, const std::string &op_name, const std::string &attr_name,
std::string &attr_value) {
std::string &attr_value) {
auto model_manager = ge::ModelManager::GetInstance();
GE_CHECK_NOTNULL(model_manager);
Status ret = model_manager->GetOpAttr(model_id, op_name, attr_name, attr_value);


+ 1
- 1
ge/graph/manager/graph_var_manager.cc View File

@@ -489,7 +489,7 @@ Status VarManager::UpdateVarMemSize(rtMemType_t memory_type, int64_t mem_size) {
mem_resource = MemResource::BuildMemResourceFromType(memory_type);
if (mem_resource == nullptr) {
REPORT_CALL_ERROR("E19999", "memory_type:%d invalid or New MemResource fail, session_id:%lu",
memory_type, session_id_);
memory_type, session_id_);
GELOGE(ge::INTERNAL_ERROR, "[Alloc][MemResource] failed, memory_type:%u, session_id:%lu",
memory_type, session_id_);
return ge::INTERNAL_ERROR;


+ 2
- 1
ge/graph/manager/util/hcom_util.cc View File

@@ -275,7 +275,8 @@ Status HcomOmeUtil::GetHcclOperationType(const ge::ConstOpDescPtr &op_desc, Hccl
"check invalid", ATTR_HOROVOD_ATTR_REDUCE_TYPE.c_str(),
op_desc->GetName().c_str(), op_desc->GetType().c_str(), horovod_op_type);
GELOGE(PARAM_INVALID, "[Check][Param] Attr:%s in Op:%s(%s), horovod_op_type value:%ld is not support now",
ATTR_HOROVOD_ATTR_REDUCE_TYPE.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str(), horovod_op_type);
ATTR_HOROVOD_ATTR_REDUCE_TYPE.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str(),
horovod_op_type);
return PARAM_INVALID;
}
op_type = iter->second;


+ 1
- 1
ge/graph/passes/atomic_addr_clean_pass.cc View File

@@ -451,7 +451,7 @@ Status AtomicAddrCleanPass::CompileUnknownGraphOp(const vector<NodePtr> &atomic_
GE_TIMESTAMP_ADD(UnknownGraphCompileOp);
if (ret != ge::SUCCESS) {
REPORT_CALL_ERROR("E19999", "Call CompileOp failed, kernel_lib_name:%s, ret:%d",
kernel_lib_name.c_str(), ret);
kernel_lib_name.c_str(), ret);
GELOGE(ret, "Compile atomic op failed, kernel lib name is %s", kernel_lib_name.c_str());
return ret;
}


+ 2
- 1
ge/graph/passes/attach_stream_label_pass.cc View File

@@ -29,7 +29,8 @@ Status AttachStreamLabelPass::Run(ComputeGraphPtr graph) {
std::map<NodePtr, NodePtr> branch_head_nodes;
FindNodes(graph, need_label_nodes, enter_nodes, branch_head_nodes);
for (const auto &node : need_label_nodes) {
GE_CHK_STATUS_RET(UpdateCondBranch(node, branch_head_nodes), "Update cond branch failed, start node:%s.", node->GetName().c_str());
GE_CHK_STATUS_RET(UpdateCondBranch(node, branch_head_nodes), "Update cond branch failed, start node:%s.",
node->GetName().c_str());
}
GE_CHK_STATUS_RET(UpdateEnterNode(enter_nodes), "UpdateEnterNode failed.");



+ 1
- 1
ge/graph/passes/bitcast_pass.cc View File

@@ -62,7 +62,7 @@ Status BitcastPass::CheckDstDataType(const OpDescPtr op_desc, ge::DataType &dst_

if (!ge::AttrUtils::GetDataType(op_desc, kAttrNameType, dst_data_type)) {
REPORT_CALL_ERROR("E19999", "Get Attr:%s of op:%s(%s) failed",
kAttrNameType, op_desc->GetName().c_str(), op_desc->GetType().c_str());
kAttrNameType, op_desc->GetName().c_str(), op_desc->GetType().c_str());
GELOGE(PARAM_INVALID, "Node failed to get attribute type.");
return PARAM_INVALID;
}


+ 1
- 1
ge/graph/passes/cond_pass.cc View File

@@ -166,7 +166,7 @@ Status CondPass::GetCondInfoForWhile(const NodePtr &node, ComputeGraphPtr &graph
if (iter == subgraph_names_to_index.end()) {
REPORT_INNER_ERROR("E19999", "subgraph name:%s not exist in SubgraphNameIndexes map of op:%s(%s), "
"check invalid", ATTR_NAME_WHILE_COND.c_str(),
op_desc->GetName().c_str(), op_desc->GetType().c_str());
op_desc->GetName().c_str(), op_desc->GetType().c_str());
GELOGE(FAILED, "Get cond_graph index failed, while_node:%s.", node->GetName().c_str());
return FAILED;
}


+ 2
- 2
ge/graph/passes/ctrl_edge_transfer_pass.cc View File

@@ -65,13 +65,13 @@ Status CtrlEdgeTransferPass::Run(ge::ComputeGraphPtr graph) {
for (auto &in_control_node : n->GetInControlNodes()) {
GE_CHECK_NOTNULL(in_control_node);
GE_CHK_GRAPH_STATUS_RET(ge::GraphUtils::RemoveEdge(in_control_node->GetOutControlAnchor(),
n->GetInControlAnchor()), "remove edge failed");
n->GetInControlAnchor()), "remove edge failed");
for (auto &out_node : n->GetOutNodes()) {
if (out_node == nullptr) {
continue;
}
GE_CHK_GRAPH_STATUS_RET(ge::GraphUtils::AddEdge(in_control_node->GetOutControlAnchor(),
out_node->GetInControlAnchor()), "add edge failed.");
out_node->GetInControlAnchor()), "add edge failed.");
}
}
}


+ 7
- 7
ge/graph/passes/hccl_memcpy_pass.cc View File

@@ -288,13 +288,13 @@ Status HcclMemcpyPass::InsertAssignAfterBroadcastIfNeed(const ComputeGraphPtr &g
}
ret = assign_out_control_anchor->LinkTo(in_data_anchor->GetOwnerNode()->GetInControlAnchor());
if (ret != SUCCESS) {
REPORT_CALL_ERROR("E19999",
"Op:%s(%s) out index:%d link to op:%s(%s) in index:%d failed",
assign_out_control_anchor->GetOwnerNode()->GetName().c_str(),
assign_out_control_anchor->GetOwnerNode()->GetType().c_str(), assign_out_control_anchor->GetIdx(),
in_data_anchor->GetOwnerNode()->GetName().c_str(),
in_data_anchor->GetOwnerNode()->GetType().c_str(),
in_data_anchor->GetIdx());
REPORT_CALL_ERROR("E19999", "Op:%s(%s) out index:%d link to op:%s(%s) in index:%d failed",
assign_out_control_anchor->GetOwnerNode()->GetName().c_str(),
assign_out_control_anchor->GetOwnerNode()->GetType().c_str(),
assign_out_control_anchor->GetIdx(),
in_data_anchor->GetOwnerNode()->GetName().c_str(),
in_data_anchor->GetOwnerNode()->GetType().c_str(),
in_data_anchor->GetIdx());
GELOGE(INTERNAL_ERROR, "The op %s link control anchor %s fail.",
assign_out_control_anchor->GetOwnerNode()->GetName().c_str(),
in_data_anchor->GetOwnerNode()->GetName().c_str());


+ 0
- 2
ge/graph/passes/inplace_support_check_pass.cc View File

@@ -78,8 +78,6 @@ Status InplaceSupportCheckPass::Run(NodePtr &node) {
AddRePassNode(node);
break;
}

GELOGD("InplaceSupportCheckPass success");
return SUCCESS;
}
} // namespace ge

+ 1
- 1
ge/graph/passes/mark_graph_unknown_status_pass.cc View File

@@ -29,7 +29,7 @@ Status MarkGraphUnknownStatusPass::Run(ComputeGraphPtr graph) {
bool forced_unknown = false;
for (const auto &node : graph->GetDirectNode()) {
GE_CHK_GRAPH_STATUS_RET(ge::NodeUtils::GetNodeUnknownShapeStatus(*node, is_unknown_shape),
"Get node[%s] shape status failed!", node->GetName().c_str());
"Get node[%s] shape status failed!", node->GetName().c_str());
if (is_unknown_shape) {
break;
}


+ 1
- 1
ge/graph/passes/multi_batch_clone_pass.cc View File

@@ -1020,7 +1020,7 @@ Status MultiBatchClonePass::SetShapeToData(const std::vector<int64_t> &shapes, c
if (!IsGetNextType(data)) {
if (NodeUtils::UpdateInputShape(*data, kDataInIndex, data_shape) != GRAPH_SUCCESS) {
REPORT_CALL_ERROR("E19999", "Update input desc shape to op:%s(%s) failed, index:%u",
data->GetName().c_str(), data->GetType().c_str(), kDataInIndex);
data->GetName().c_str(), data->GetType().c_str(), kDataInIndex);
GELOGE(INTERNAL_ERROR, "Failed to update input shape for data %s", data->GetName().c_str());
return INTERNAL_ERROR;
}


+ 1
- 1
ge/graph/passes/multi_batch_pass.cc View File

@@ -759,7 +759,7 @@ Status MultiBatchPass::AttachStreamLabel(uint32_t batch_idx, const std::string &
GELOGD("Attach stream_label %s to node %s.", stream_label.c_str(), cur_desc->GetName().c_str());
if (SetStreamLabel(cur_node, stream_label) != SUCCESS) {
REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed",
stream_label.c_str(), cur_node->GetName().c_str(), cur_node->GetType().c_str());
stream_label.c_str(), cur_node->GetName().c_str(), cur_node->GetType().c_str());
GELOGE(FAILED, "Set stream_label failed, node:%s.", cur_node->GetName().c_str());
return FAILED;
}


+ 7
- 8
ge/graph/passes/net_output_pass.cc View File

@@ -73,7 +73,7 @@ Status NetOutputPass::GetRetvalOutputInfo(const ge::NodePtr &node,
if (iter != targets_.end()) {
targets_.erase(iter);
targets_.insert(src_node_ptr);
GELOGI("node [%s] is in user def targets, do not output result to user!", node->GetName().c_str());
GELOGI("Node [%s] is in user def targets, do not output result to user!", node->GetName().c_str());
}
is_include_special_node_ = true;
return SUCCESS;
@@ -105,7 +105,7 @@ Status NetOutputPass::GetOutputNode(const ge::ComputeGraphPtr &graph, std::vecto
for (auto &ele : graph->GetGraphOutNodesInfo()) {
auto iter = targets_.find(ele.first);
if (iter != targets_.end()) {
GELOGI("user set out node [%s] is found in user def targets, out node is prio!", ele.first->GetName().c_str());
GELOGI("User set out node [%s] is found in user def targets, out node is prior!", ele.first->GetName().c_str());
targets_.erase(iter);
}

@@ -213,7 +213,7 @@ Status NetOutputPass::UpdateNetOutputDesc(const ge::NodePtr &net_output) {
std::vector<bool> is_input_const;
for (const auto &in_anchor : net_output->GetAllInDataAnchors()) {
GE_CHECK_NOTNULL(in_anchor);
uint32_t index = static_cast<uint32_t>(in_anchor->GetIdx());
auto index = static_cast<uint32_t>(in_anchor->GetIdx());
if (index >= net_output_desc->GetAllInputsDesc().size()) {
REPORT_INNER_ERROR("E19999", "Node:%s(%s) has in_anchor index:%u >= its input desc num:%zu, check invalid",
net_output_desc->GetName().c_str(), net_output_desc->GetType().c_str(), index,
@@ -369,10 +369,9 @@ Status NetOutputPass::UnLinkDataAnchorOfNetoutput(const ge::ComputeGraphPtr &gra
if (!CheckNodeIsInOutputNodes(graph, node)) {
ret = in_data_anchor->Unlink(peer_out_anchor);
if (ret != SUCCESS) {
REPORT_CALL_ERROR("E19999",
"Op:%s(%s) out index:%d unlink from op:%s(%s) in index:%d failed",
net_out_node->GetName().c_str(), net_out_node->GetType().c_str(), in_data_anchor->GetIdx(),
node->GetName().c_str(), node->GetType().c_str(), peer_out_anchor->GetIdx());
REPORT_CALL_ERROR("E19999", "Op:%s(%s) out index:%d unlink from op:%s(%s) in index:%d failed",
net_out_node->GetName().c_str(), net_out_node->GetType().c_str(), in_data_anchor->GetIdx(),
node->GetName().c_str(), node->GetType().c_str(), peer_out_anchor->GetIdx());
GELOGE(INTERNAL_ERROR, "Unlink peer_out_anchor fail!");
return ret;
}
@@ -565,7 +564,7 @@ Status NetOutputPass::AddNetOutputNodeToGraph(const ge::ComputeGraphPtr &graph,
GELOGI("[NETOUTPUT PASS] Add net output node succeed");
return SUCCESS;
}
GELOGI("[NETOUTPUT PASS] Output node size:%lu.", output_nodes_info.size());
GELOGI("[NETOUTPUT PASS] Output node size:%zu.", output_nodes_info.size());
if (output_nodes_info.empty()) {
// because retval node is contained by output_nodes_info, here means targets is non-empty
output_node = graph->AddNode(net_output_desc);


+ 1
- 1
ge/graph/passes/pass_utils.cc View File

@@ -170,7 +170,7 @@ Status PassUtils::SetOutNodeWeight(const OutDataAnchorPtr &out_data_anchor, cons
// restore control inputs to dynamically added constant ops, if any
for (const auto &src_out_control_anchor : src_out_control_anchors) {
GE_CHK_GRAPH_STATUS_RET(GraphUtils::AddEdge(src_out_control_anchor, dynamic_const_node->GetInControlAnchor()),
"add edge failed");
"add edge failed");
}
}



+ 1
- 1
ge/graph/passes/switch_data_edges_bypass.cc View File

@@ -51,7 +51,7 @@ std::vector<std::pair<NodePtr, InDataAnchorPtr>> GetOutDataNodesByIndex(const No
auto out_anchor = node->GetOutDataAnchor(index);
if (out_anchor == nullptr) {
REPORT_INNER_ERROR("E19999", "Node:%s(%s) has no index:%d out data anchor, check invalid",
node->GetName().c_str(), node->GetType().c_str(), index);
node->GetName().c_str(), node->GetType().c_str(), index);
GELOGE(PARAM_INVALID, "Failed to get out data nodes of index %d from node %s, the anchor does not exists", index,
node->GetName().c_str());
return {};


+ 6
- 6
ge/graph/passes/transop_without_reshape_fusion_pass.cc View File

@@ -1077,9 +1077,9 @@ graphStatus TransOpWithoutReshapeFusionPass::RelinkControlEdge(const int index,
peer_in_anchor->GetOwnerNode()->GetName().c_str());
if (GraphUtils::AddEdge(new_trans_nodes.back()->GetOutControlAnchor(), peer_in_anchor) != GRAPH_SUCCESS) {
REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed",
new_trans_nodes.back()->GetName().c_str(), new_trans_nodes.back()->GetType().c_str(),
peer_in_anchor->GetOwnerNode()->GetName().c_str(),
peer_in_anchor->GetOwnerNode()->GetType().c_str());
new_trans_nodes.back()->GetName().c_str(), new_trans_nodes.back()->GetType().c_str(),
peer_in_anchor->GetOwnerNode()->GetName().c_str(),
peer_in_anchor->GetOwnerNode()->GetType().c_str());
return GRAPH_FAILED;
}
}
@@ -1103,9 +1103,9 @@ graphStatus TransOpWithoutReshapeFusionPass::RelinkControlEdge(const int index,
peer_in_anchor->GetOwnerNode()->GetName().c_str());
if (GraphUtils::AddEdge(new_trans_nodes.back()->GetOutControlAnchor(), peer_in_anchor) != GRAPH_SUCCESS) {
REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed",
new_trans_nodes.back()->GetName().c_str(), new_trans_nodes.back()->GetType().c_str(),
peer_in_anchor->GetOwnerNode()->GetName().c_str(),
peer_in_anchor->GetOwnerNode()->GetType().c_str());
new_trans_nodes.back()->GetName().c_str(), new_trans_nodes.back()->GetType().c_str(),
peer_in_anchor->GetOwnerNode()->GetName().c_str(),
peer_in_anchor->GetOwnerNode()->GetType().c_str());
return GRAPH_FAILED;
}
}


+ 4
- 4
ge/graph/passes/variable_op_pass.cc View File

@@ -87,10 +87,10 @@ Status ByPassTransNode(NodePtr &trans_node, NodePtr &ref_node) {
ret = GraphUtils::AddEdge(prev_trans_node_out_anchor, ref_in_anchor);
if (ret != GRAPH_SUCCESS) {
REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%d) and op:%s(%s)(index:0) failed",
prev_trans_node_out_anchor->GetOwnerNode()->GetName().c_str(),
prev_trans_node_out_anchor->GetOwnerNode()->GetType().c_str(),
prev_trans_node_out_anchor->GetIdx(),
ref_node->GetName().c_str(), ref_node->GetType().c_str());
prev_trans_node_out_anchor->GetOwnerNode()->GetName().c_str(),
prev_trans_node_out_anchor->GetOwnerNode()->GetType().c_str(),
prev_trans_node_out_anchor->GetIdx(),
ref_node->GetName().c_str(), ref_node->GetType().c_str());
GELOGE(INTERNAL_ERROR,
"Failed to add edge between ref node %s "
"and the prev node of trans node %s",


+ 2
- 2
ge/graph/preprocess/graph_preprocess.cc View File

@@ -241,7 +241,7 @@ NodePtr CreateTransNode(const std::string &name, const std::string &node_type, c
ret = op_desc->AddInputDesc(shape_desc->GetOutputDesc(0));
if (ret != GRAPH_SUCCESS) {
REPORT_CALL_ERROR("E19999", "Add input desc into op:%s(%s) failed",
op_desc->GetName().c_str(), op_desc->GetType().c_str());
op_desc->GetName().c_str(), op_desc->GetType().c_str());
GELOGE(INTERNAL_ERROR, "Failed to add the first input for reshape %s", name.c_str());
return nullptr;
}
@@ -837,7 +837,7 @@ Status ProcessInputNC1HWC0DynShape(NodePtr &node_ptr, bool &is_dynamic_batch, No
old_shape = switchn_output->GetShape();
if (ModifyFormatAndShapeForSingleTensor(switchn_output) != SUCCESS) {
REPORT_CALL_ERROR("E19999", "Modify format and shape of output:%u in op:%s(%s) failed", i,
switchn_op_desc->GetName().c_str(), switchn_op_desc->GetType().c_str());
switchn_op_desc->GetName().c_str(), switchn_op_desc->GetType().c_str());
GELOGE(INTERNAL_ERROR, "modify format and shape failed");
return FAILED;
}


+ 2
- 2
ge/graph/preprocess/multi_batch_copy_graph.cc View File

@@ -1266,8 +1266,8 @@ Status MultiBatchGraphCopyer::LinkNodeToMerge(const NodePtr &node, int out_index
auto ret = GraphUtils::AddEdge(src_node->GetOutDataAnchor(out_index), merge->GetInDataAnchor(i));
if (ret != GRAPH_SUCCESS) {
REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%zu) failed",
src_node->GetName().c_str(), src_node->GetType().c_str(), out_index,
merge->GetName().c_str(), merge->GetType().c_str(), i);
src_node->GetName().c_str(), src_node->GetType().c_str(), out_index,
merge->GetName().c_str(), merge->GetType().c_str(), i);
GELOGE(INTERNAL_ERROR,
"Failed to add edge between copyed node %s(%d) to inserted merge node %s(%zu), error-code %u",
copyed_nodes[i]->GetName().c_str(), out_index, merge->GetName().c_str(), i, ret);


+ 2
- 3
ge/hybrid/node_executor/aicore/aicore_op_task.cc View File

@@ -420,9 +420,8 @@ Status AiCoreOpTask::CalcTilingInfo(const NodePtr &node, OpRunInfo &tiling_info)
}

Status AiCoreOpTask::UpdateArgs(TaskContext &task_context) {
size_t expected_arg_count = task_context.NumInputs() + task_context.NumOutputs() +
task_context.NumWorkspaces()
- output_indices_to_skip_.size();
size_t expected_arg_count = task_context.NumInputs() + task_context.NumOutputs() + task_context.NumWorkspaces() -
output_indices_to_skip_.size();
if (tiling_buffer_ != nullptr) {
++expected_arg_count;
}


+ 1
- 1
ge/hybrid/node_executor/rts/rts_task_factory.h View File

@@ -61,6 +61,6 @@ class RtsTaskFactory {
REGISTER_RTS_TASK_CREATOR_UNIQ_HELPER(__COUNTER__, task_type, task_clazz)

#define REGISTER_RTS_TASK_CREATOR_UNIQ_HELPER(ctr, type, clazz) \
RtsTaskFactory::RtsTaskRegistrar g_##type##_Creator##ctr(type, []()-> RtsNodeTaskPtr { return MakeShared<clazz>(); })
RtsTaskFactory::RtsTaskRegistrar g_##type##_Creator##ctr(type, []()->RtsNodeTaskPtr { return MakeShared<clazz>(); })

#endif // GE_HYBRID_NODE_EXECUTOR_RTS_TASK_FACTORY_H_

+ 6
- 3
ge/ir_build/option_utils.cc View File

@@ -37,6 +37,9 @@ const size_t kMaxNDDimNum = 4;
const size_t kMinNDDimNum = 1;
const size_t kSquareBracketsSize = 2;
const size_t kRangePairSize = 2;
const size_t kShapeRangeSize = 2;
const size_t kShapeRangeStrIndex = 2;
const size_t kShapeRangeStrSize = 3;
// datatype/formats from user to GE, Unified to util interface file later
const std::map<std::string, ge::DataType> kOutputTypeSupportDatatype = {
{"FP32", ge::DT_FLOAT}, {"FP16", ge::DT_FLOAT16}, {"UINT8", ge::DT_UINT8}};
@@ -434,7 +437,7 @@ Status ParseInputShapeRange(const std::string &shape_range,
std::vector<std::vector<std::pair<int64_t, int64_t>>> &range) {
GELOGD("Input shape range %s", shape_range.c_str());

if (shape_range.size() < 2) {
if (shape_range.size() < kShapeRangeSize) {
REPORT_INPUT_ERROR("E10048", std::vector<std::string>({"shape_range", "reason", "sample"}),
std::vector<std::string>({shape_range, kInputShapeRangeSizeInvalid, kInputShapeRangeSample4}));
GELOGE(PARAM_INVALID, "[Parse][ShapeRange] str:%s invalid, reason: %s, correct sample is %s.",
@@ -451,7 +454,7 @@ Status ParseInputShapeRange(const std::string &shape_range,
return PARAM_INVALID;
}
for (auto &shape_range_str : shape_range_set) {
if (shape_range_str.size() < 3) {
if (shape_range_str.size() < kShapeRangeStrSize) {
// shape_range_str should be "[2~3,1"
// or ",[2~3,1". because we should trim '[' or ',['
// so shape_range_str.size() < 3 is invalid
@@ -462,7 +465,7 @@ Status ParseInputShapeRange(const std::string &shape_range,
shape_range_str = shape_range_str.substr(1, shape_range_str.size());
}
if (ge::StringUtils::StartWith(shape_range_str, ",")) {
shape_range_str = shape_range_str.substr(2, shape_range_str.size());
shape_range_str = shape_range_str.substr(kShapeRangeStrIndex, shape_range_str.size());
}

// parse shape_range of single input. eg. "1~20,3,3~6,-1"


Loading…
Cancel
Save