From 2cbef0a7345561126e40971145691594a13b2a47 Mon Sep 17 00:00:00 2001 From: Rohit Kumar Srivastava Date: Thu, 24 Sep 2020 23:51:38 +0000 Subject: [PATCH] delete executor before reallocating it memory --- src/executor/graph_executor.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/executor/graph_executor.cc b/src/executor/graph_executor.cc index c7febc4712f1..28b79aeda1ee 100644 --- a/src/executor/graph_executor.cc +++ b/src/executor/graph_executor.cc @@ -2006,6 +2006,7 @@ Executor *Executor::SimpleBind(nnvm::Symbol symbol, default_ctx, group2ctx, &tmp_in_arg_ctxes, &tmp_arg_grad_ctxes, &tmp_grad_req_types, &tmp_aux_state_ctxes, verbose); // Subgraph cannot be recreated from unoptimized symbol + delete exec; exec = new exec::GraphExecutor(symbol); exec->Init(symbol.Copy(), default_ctx, group2ctx, tmp_in_arg_ctxes, tmp_arg_grad_ctxes, tmp_aux_state_ctxes, arg_shape_map, arg_dtype_map, arg_stype_map, @@ -2077,6 +2078,7 @@ Executor *Executor::Bind(nnvm::Symbol symbol, &tmp_arg_grad_store, &tmp_grad_req_type, &tmp_aux_states, verbose); // Subgraph cannot be recreated from unoptimized symbol + delete exec; exec = new exec::GraphExecutor(symbol); } }