From 986b549eb391fd0bca0eaaed197636be06fc7f6b Mon Sep 17 00:00:00 2001 From: tmccrmck Date: Tue, 23 Apr 2019 16:05:51 -0700 Subject: [PATCH] Pass environment by pointer instead of shared_ptr to executor --- onnxruntime/hosting/executor.h | 4 ++-- onnxruntime/hosting/http/predict_request_handler.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/onnxruntime/hosting/executor.h b/onnxruntime/hosting/executor.h index 2b60c6d5e4d57..17a0fb5ab8321 100644 --- a/onnxruntime/hosting/executor.h +++ b/onnxruntime/hosting/executor.h @@ -13,7 +13,7 @@ namespace hosting { class Executor { public: - Executor(std::shared_ptr hosting_env, std::string request_id) : env_(hosting_env), + Executor(HostingEnvironment* hosting_env, std::string request_id) : env_(hosting_env), request_id_(std::move(request_id)), using_raw_data_(true) {} @@ -24,7 +24,7 @@ class Executor { /* out */ onnxruntime::hosting::PredictResponse& response); private: - std::shared_ptr env_; + HostingEnvironment* env_; const std::string request_id_; bool using_raw_data_; diff --git a/onnxruntime/hosting/http/predict_request_handler.cc b/onnxruntime/hosting/http/predict_request_handler.cc index 442d07cb1ed7d..c1439e1c1b659 100644 --- a/onnxruntime/hosting/http/predict_request_handler.cc +++ b/onnxruntime/hosting/http/predict_request_handler.cc @@ -63,7 +63,7 @@ void Predict(const std::string& name, // Run Prediction protobufutil::Status status; - Executor executor(env, context.request_id); + Executor executor(env.get(), context.request_id); PredictResponse predict_response{}; status = executor.Predict(name, version, predict_request, predict_response); if (!status.ok()) {