9 #ifndef PHYSICSTOOLS_TENSORFLOW_TENSORFLOW_H 10 #define PHYSICSTOOLS_TENSORFLOW_TENSORFLOW_H 12 #include "tensorflow/core/public/session.h" 13 #include "tensorflow/core/framework/tensor.h" 14 #include "tensorflow/cc/saved_model/loader.h" 15 #include "tensorflow/cc/saved_model/tag_constants.h" 16 #include "tensorflow/cc/saved_model/constants.h" 17 #include "tensorflow/core/lib/io/path.h" 18 #include "tensorflow/core/util/tensor_bundle/naming.h" 33 void setThreading(SessionOptions& sessionOptions,
int nThreads,
34 const std::string& singleThreadPool =
"no_threads");
40 SessionOptions& sessionOptions);
64 SessionOptions& sessionOptions);
86 const std::vector<std::string>& outputNames,
const std::vector<std::string>& targetNodes,
93 const std::vector<Tensor>& inputTensors,
const std::vector<std::string>& outputNames,
94 const std::vector<std::string>& targetNodes, std::vector<Tensor>*
outputs);
99 const std::vector<std::string>& outputNames, std::vector<Tensor>*
outputs);
104 const std::vector<Tensor>& inputTensors,
const std::vector<std::string>& outputNames,
109 #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
bool closeSession(Session *&session)
void setThreading(SessionOptions &sessionOptions, int nThreads, const std::string &singleThreadPool="no_threads")
void setLogging(const std::string &level="3")
void run(Session *session, const NamedTensorList &inputs, const std::vector< std::string > &outputNames, const std::vector< std::string > &targetNodes, std::vector< Tensor > *outputs)