141 for(
const auto& graph_entry : graph_names) {
142 tensorflow::SessionOptions
options;
146 const std::string& graph_file = graph_entry.second;
150 if(!mmap_status.ok()) {
151 throw cms::Exception(
"DeepTauCache: unable to initalize memmapped environment for ")
152 << graph_file <<
". \n" << mmap_status.ToString();
155 graphs_[entry_name] = std::make_unique<tensorflow::GraphDef>();
157 tensorflow::MemmappedFileSystem::kMemmappedPackageDefaultGraphDef,
159 if(!load_graph_status.ok())
160 throw cms::Exception(
"DeepTauCache: unable to load graph from ") << graph_file <<
". \n" 161 << mmap_status.ToString();
162 options.config.mutable_graph_options()->mutable_optimizer_options()->set_opt_level(::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_