134 for (
const auto& graph_entry : graph_names) {
135 tensorflow::SessionOptions
options;
139 const std::string& graph_file = graph_entry.second;
143 if (!mmap_status.ok()) {
144 throw cms::Exception(
"DeepTauCache: unable to initalize memmapped environment for ")
145 << graph_file <<
". \n" 146 << mmap_status.ToString();
149 graphs_[entry_name] = std::make_unique<tensorflow::GraphDef>();
152 tensorflow::MemmappedFileSystem::kMemmappedPackageDefaultGraphDef,
154 if (!load_graph_status.ok())
155 throw cms::Exception(
"DeepTauCache: unable to load graph from ") << graph_file <<
". \n" 156 << mmap_status.ToString();
157 options.config.mutable_graph_options()->mutable_optimizer_options()->set_opt_level(
158 ::tensorflow::OptimizerOptions::L0);
Session * createSession(SessionOptions &sessionOptions)
std::map< std::string, tensorflow::Session * > sessions_
GraphDef * loadGraphDef(const std::string &pbFile)
void setThreading(SessionOptions &sessionOptions, int nThreads, const std::string &singleThreadPool="no_threads")
std::map< std::string, GraphPtr > graphs_
std::map< std::string, std::unique_ptr< tensorflow::MemmappedEnv > > memmappedEnv_