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" 119 const thread::ThreadPoolOptions& threadPoolOptions);
126 const thread::ThreadPoolOptions& threadPoolOptions) {
139 thread::ThreadPoolInterface* threadPool);
146 thread::ThreadPoolInterface* threadPool) {
166 const std::string& threadPoolName =
"no_threads") {
184 const std::string& threadPoolName =
"no_threads") {
200 template <
typename... Args>
210 template <
typename... Args>
225 #endif // PHYSICSTOOLS_TENSORFLOW_TENSORFLOW_H
std::vector< NamedTensor > NamedTensorList
void setBackend(Backend backend=Backend::cpu)
GraphDef * loadGraphDef(const std::string &pbFile)
MetaGraphDef * loadMetaGraphDef(const std::string &exportDir, const std::string &tag=kSavedModelTagServe)
Backend getBackend() const
std::pair< std::string, Tensor > NamedTensor
std::atomic< Session * > session
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)
bool checkEmptyInputs(const NamedTensorList &inputs)
MetaGraphDef * loadMetaGraph(const std::string &exportDir, const std::string &tag, Options &Options)
Session * createSession()
const Session * getSession() const
void setLogging(const std::string &level="3")
std::atomic< GraphDef * > graph
SessionCache(const std::string &graphPath, Args &&... sessionArgs)
void setThreading(int nThreads=1)
SessionOptions & getSessionOptions()