From 60ccc0da05e1eb670cd94c53d82a32acc1f753ab Mon Sep 17 00:00:00 2001 From: Tianqi Chen Date: Thu, 6 Oct 2016 12:07:14 -0700 Subject: [PATCH] Fix Plan memory when multiple inplace option is available (#67) --- src/pass/plan_memory.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pass/plan_memory.cc b/src/pass/plan_memory.cc index f77e70085fbc..317fef0275bf 100644 --- a/src/pass/plan_memory.cc +++ b/src/pass/plan_memory.cc @@ -174,6 +174,7 @@ Graph PlanMemory(Graph ret) { uint32_t eid_out = idx.entry_id(nid, kv.second); uint32_t eid_in = idx.entry_id(inode.inputs[kv.first]); if (ref_count[eid_in] == 1 && + storage[eid_out] == GraphAllocator::kBadStorageID && storage[eid_in] != GraphAllocator::kBadStorageID && shape_vec[eid_out].Size() == shape_vec[eid_in].Size() && dtype_vec[eid_out] == dtype_vec[eid_in]) {