From e071d75ba39d8b2cab6d4f4c29e757ea6cdf4ebf Mon Sep 17 00:00:00 2001 From: lichun Date: Sun, 25 Apr 2021 15:39:12 +0800 Subject: [PATCH] mark attr distance --- ge/graph/build/memory/graph_mem_assigner.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ge/graph/build/memory/graph_mem_assigner.cc b/ge/graph/build/memory/graph_mem_assigner.cc index 732a4a59..7d01dcc3 100755 --- a/ge/graph/build/memory/graph_mem_assigner.cc +++ b/ge/graph/build/memory/graph_mem_assigner.cc @@ -36,6 +36,7 @@ namespace { const int kAllInputAddrIsAtomic = -1; const int kVirtualInputNodeMemoryReuse = 0; const int kVirtualOutputNodeMemoryReuse = 1; +const int kPrevNextDistanceNum = 2; const int64_t kInvalidStream = -1; const char *const kEngineNameGeLocal = "DNN_VM_GE_LOCAL_OP_STORE"; // One state per bit cannot be repeated @@ -1979,7 +1980,7 @@ static void UpdatePrevNodeInputDesc(const NodePtr &prev_node, continue; } - if (prev_next_distances.size() == 2) { + if (prev_next_distances.size() == kPrevNextDistanceNum) { prev_next_distances[1] = distance; } else { GELOGW("Size of prev_next_distances is not 2."); @@ -2114,7 +2115,7 @@ void GraphMemoryAssigner::MarkNodeDistanceAttr(const ComputeGraphPtr &compute_gr GELOGW("Get ATTR_NAME_DATA_VISIT_DISTANCE failed."); continue; } - if (prev_next_distances.size() != 2) { + if (prev_next_distances.size() != kPrevNextDistanceNum) { GELOGW("Size of prev_next_distance is not 2."); continue; } else {