Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
delete executor before reallocating it memory (#19214)
Browse files Browse the repository at this point in the history
Co-authored-by: Rohit Kumar Srivastava <[email protected]>
  • Loading branch information
access2rohit and Rohit Kumar Srivastava authored Sep 25, 2020
1 parent 2b055b7 commit 125e491
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/executor/graph_executor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 125e491

Please sign in to comment.