8 #ifndef PHYSICSTOOLS_TENSORFLOW_TENSORFLOW_H 9 #define PHYSICSTOOLS_TENSORFLOW_TENSORFLOW_H 11 #include "tensorflow/core/framework/tensor.h" 12 #include "tensorflow/core/lib/core/threadpool.h" 13 #include "tensorflow/core/lib/io/path.h" 14 #include "tensorflow/core/public/session.h" 15 #include "tensorflow/core/util/tensor_bundle/naming.h" 16 #include "tensorflow/cc/client/client_session.h" 17 #include "tensorflow/cc/saved_model/loader.h" 18 #include "tensorflow/cc/saved_model/constants.h" 19 #include "tensorflow/cc/saved_model/tag_constants.h" 35 void setThreading(SessionOptions& sessionOptions,
int nThreads = 1);
80 SessionOptions& sessionOptions);
113 const thread::ThreadPoolOptions& threadPoolOptions);
120 const thread::ThreadPoolOptions& threadPoolOptions) {
133 thread::ThreadPoolInterface* threadPool);
140 thread::ThreadPoolInterface* threadPool) {
160 const std::string& threadPoolName =
"no_threads") {
178 const std::string& threadPoolName =
"no_threads") {
194 template <
typename... Args>
204 template <
typename... Args>
219 #endif // PHYSICSTOOLS_TENSORFLOW_TENSORFLOW_H Session * createSession(SessionOptions &sessionOptions)
std::vector< NamedTensor > NamedTensorList
GraphDef * loadGraphDef(const std::string &pbFile)
MetaGraphDef * loadMetaGraph(const std::string &exportDir, const std::string &tag, SessionOptions &sessionOptions)
std::pair< std::string, Tensor > NamedTensor
std::atomic< Session * > session
void setThreading(SessionOptions &sessionOptions, int nThreads=1)
void createSession(const std::string &graphPath, Args &&... sessionArgs)
void run(Session *session, const NamedTensorList &inputs, const std::vector< std::string > &outputNames, std::vector< Tensor > *outputs, const thread::ThreadPoolOptions &threadPoolOptions)
bool closeSession(Session *&session)
const Session * getSession() const
void setLogging(const std::string &level="3")
std::atomic< GraphDef * > graph
MetaGraphDef * loadMetaGraphDef(const std::string &exportDir, const std::string &tag, SessionOptions &sessionOptions)
SessionCache(const std::string &graphPath, Args &&... sessionArgs)