Re-order InferenceSession::session_state_ in the member declaration (#1068)

* Re-order InferenceSession::session_state_ in the member declaration

* fix initialization list
This commit is contained in:
Tao Qin 2019-05-21 11:31:20 -07:00 committed by GitHub
parent a42222f9de
commit 64aa55eac8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View file

@ -89,11 +89,11 @@ inline std::basic_string<T> GetCurrentTimeString() {
} // namespace
InferenceSession::InferenceSession(const SessionOptions& session_options, logging::LoggingManager* logging_manager)
: session_state_(execution_providers_,
session_options.enable_mem_pattern && session_options.enable_sequential_execution),
session_options_{session_options},
: session_options_{session_options},
graph_transformation_mgr_{session_options_.max_num_graph_transformation_steps},
logging_manager_{logging_manager},
session_state_(execution_providers_,
session_options.enable_mem_pattern && session_options.enable_sequential_execution),
insert_cast_transformer_{"CastFloat16Transformer"} {
ORT_ENFORCE(Environment::IsInitialized(),
"Environment must be initialized before creating an InferenceSession.");

View file

@ -312,9 +312,6 @@ class InferenceSession {
// if they need.
std::shared_ptr<onnxruntime::Model> model_;
// Immutable state for each op in the model. Shared by all executors.
SessionState session_state_;
// names of model outputs used for quick validation.
std::unordered_set<std::string> model_output_names_;
@ -391,6 +388,12 @@ class InferenceSession {
ExecutionProviders execution_providers_;
protected:
// Immutable state for each op in the model. Shared by all executors.
// It has a dependency on execution_providers_.
SessionState session_state_;
private:
KernelRegistryManager kernel_registry_manager_;
std::list<std::shared_ptr<onnxruntime::IOnnxRuntimeOpSchemaCollection>> custom_schema_registries_;
@ -417,6 +420,5 @@ class InferenceSession {
//CustomRegistry objects own the corresponding KernelRegistry and OnnxRuntimeOpSchemaRegistry objects.
//So its lifetime should be same as its constituents. This vector is to extend the lifetime of the owner.
std::vector<std::shared_ptr<CustomRegistry>> custom_registries_;
};
} // namespace onnxruntime