HiPipe  0.7.0
C++17 data pipeline with Python bindings.
Functions
TensorFlow graph evaluation.

Functions

std::unique_ptr<::tensorflow::Session > hipipe::tensorflow::load_graph (std::experimental::filesystem::path graph_file_name)
 Make a session out of tensorflow frozen graph. More...
 
template<typename... OutTs, typename... InTs>
std::tuple< std::tuple< std::vector< OutTs >... >, std::vector< std::vector< long > > > hipipe::tensorflow::run_graph (::tensorflow::Session &session, const std::vector< std::string > &input_names, const std::tuple< std::vector< InTs >... > &input_data, const std::vector< std::vector< long >> &input_shapes, const std::vector< std::string > &output_names)
 Run a session and feed its graph with the provided inputs. More...
 

Detailed Description

Function Documentation

◆ load_graph()

std::unique_ptr<::tensorflow::Session> hipipe::tensorflow::load_graph ( std::experimental::filesystem::path  graph_file_name)

Make a session out of tensorflow frozen graph.

Parameters
graph_file_nameFile with the frozen graph.
Returns
A pointer to a tensorflow session with the graph.

◆ run_graph()

template<typename... OutTs, typename... InTs>
std::tuple<std::tuple<std::vector<OutTs>...>, std::vector<std::vector<long> > > hipipe::tensorflow::run_graph ( ::tensorflow::Session &  session,
const std::vector< std::string > &  input_names,
const std::tuple< std::vector< InTs >... > &  input_data,
const std::vector< std::vector< long >> &  input_shapes,
const std::vector< std::string > &  output_names 
)

Run a session and feed its graph with the provided inputs.

The session can be obtained using load_graph().

The lengths of input_names, input_shapes and input_data arguments have to be equal. The lengths of output_names and the OutT template parameter list have to be equal.

Parameters
sessionPointer to the session to be run.
input_namesNames of the input variables for the TF graph.
input_dataThe data to be fed to the selected input variables.
input_shapesShapes of the input variables including the batch dimension.
output_namesThe names of the variables to be extracted from the TF graph.
Returns
Tuple of output data and their corresponding shapes.

Definition at line 49 of file run_graph.hpp.