diff --git a/src/executor/graph_executor.cc b/src/executor/graph_executor.cc index 54a8d224ff42..922917f79475 100644 --- a/src/executor/graph_executor.cc +++ b/src/executor/graph_executor.cc @@ -44,6 +44,7 @@ GraphExecutor::GraphExecutor() { log_verbose_ = dmlc::GetEnv("MXNET_EXEC_VERBOSE_LOGGING", false); need_grad_ = false; subgraph_property_ = dmlc::GetEnv("MXNET_SUBGRAPH_BACKEND", std::string()); + engine_ref_ = Engine::_GetSharedRef(); } GraphExecutor::~GraphExecutor() { diff --git a/src/executor/graph_executor.h b/src/executor/graph_executor.h index b94bb4377786..f5f032e3f2e6 100644 --- a/src/executor/graph_executor.h +++ b/src/executor/graph_executor.h @@ -260,6 +260,8 @@ class GraphExecutor : public Executor { bool log_verbose_ = false; // subgraph property name std::string subgraph_property_; + // ref of engine + std::shared_ptr engine_ref_; }; } // namespace exec