diff --git a/ge/graph/build/memory/block_mem_assigner.cc b/ge/graph/build/memory/block_mem_assigner.cc index 39718901..8f3199de 100755 --- a/ge/graph/build/memory/block_mem_assigner.cc +++ b/ge/graph/build/memory/block_mem_assigner.cc @@ -826,19 +826,20 @@ bool BlockMemAssigner::IsContinuousOutput(const NodePtr &n) { return false; } + auto node_desc = n->GetOpDesc(); + if (node_desc == nullptr) { + GELOGE(FAILED, "Node[%s] nodedesc is null.", n->GetName().c_str()); + return false; + } + // if output size just one, no need to reassign continuous memory - if (node_op_desc->GetOutputsSize() == 1) { + if (node_desc->GetOutputsSize() == 1) { GELOGI("op %s output size is one, no need to continuous process.", n->GetName().c_str()); return false; } // Get the continuous output type of the node, default is false bool is_output_continuous = false; - auto node_desc = n->GetOpDesc(); - if (node_desc == nullptr) { - GELOGE(FAILED, "Node[%s] nodedesc is null.", n->GetName().c_str()); - return false; - } // If GetBool fail, is_output_continuous is false. (void)ge::AttrUtils::GetBool(node_desc, ATTR_NAME_CONTINUOUS_OUTPUT, is_output_continuous);