From 07d7e139db70fc7d9d25b5b830ac5ed32ff14811 Mon Sep 17 00:00:00 2001 From: Rohit Kumar Srivastava Date: Fri, 25 Sep 2020 18:03:40 -0700 Subject: [PATCH] delete executor before reallocating it memory (#19222) Co-authored-by: Rohit Kumar Srivastava --- 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); } }