From a1f23dd1d09e9000756b5184c3930b8900c55ffe Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 18 Dec 2020 17:44:54 +0800 Subject: [PATCH] For dynamic shape complie. --- ge/graph/build/graph_builder.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ge/graph/build/graph_builder.cc b/ge/graph/build/graph_builder.cc index 1e84ee1a..c7a18350 100644 --- a/ge/graph/build/graph_builder.cc +++ b/ge/graph/build/graph_builder.cc @@ -198,10 +198,8 @@ Status GraphBuilder::Build(ComputeGraphPtr &comp_graph, std::vectorGetGraphUnknownFlag()) { GE_CHK_STATUS_RET( BuildForDynamicShapeGraph(comp_graph, subgraph_ptr_list, ge_root_model_ptr, ge_model_ptr, session_id), "Build for dynamic shape graph failed."); @@ -290,7 +288,7 @@ Status GraphBuilder::BuildForUnknownShapeGraph(ComputeGraphPtr &comp_graph, GeMo GE_DUMP(comp_graph, "AfterCalcOpParam"); - for (auto &node : comp_graph->GetsDirectNode()) { + for (auto &node : comp_graph->GetsDirectNode()) { GE_CHECK_NOTNULL(node); auto op_desc = node->GetOpDesc(); GE_CHECK_NOTNULL(op_desc); @@ -313,8 +311,8 @@ Status GraphBuilder::BuildForUnknownShapeGraph(ComputeGraphPtr &comp_graph, GeMo continue; } - std::vector weight = OpDescUtils::MutableWeights(peer_node); - if (weight.empty()) { + std::vector weights = OpDescUtils::MutableWeights(peer_node); + if (weights.empty()) { GELOGE(FAILED, "weights size of node %s is empty", node->GetName().c_str()); return FAILED; } @@ -322,7 +320,7 @@ Status GraphBuilder::BuildForUnknownShapeGraph(ComputeGraphPtr &comp_graph, GeMo GE_CHECK_NOTNULL(weight); int64_t input_offset = 0; (void) TensorUtils::GetDataOffset(weight->MutableTensorDesc(), input_offset); - input_offsetp[valid_input_index] = input_offset; + input_offsets[valid_input_index] = input_offset; GELOGD("[%s] input[%u] is const, offset = %ld", node->GetName().c_str(), valid_input_index, input_offset); }