Functions
tf_utils Namespace Reference

Functions

static void DeallocateBuffer (void *data, size_t)
 
static TF_Buffer * ReadBufferFromFile (const char *file)
 
TF_Graph * LoadGraph (const char *graphPath)
 
void DeleteSession (TF_Session *session)
 
TF_Tensor * CreateTensor (TF_DataType data_type, const std::int64_t *dims, std::size_t num_dims, const void *data, std::size_t len)
 
void DeleteTensor (TF_Tensor *tensor)
 
void DeleteGraph (TF_Graph *graph)
 
TF_Session * CreateSession (TF_Graph *graph)
 
TF_Code RunSession (TF_Session *session, const TF_Output *inputs, TF_Tensor *const *input_tensors, std::size_t ninputs, const TF_Output *outputs, TF_Tensor **output_tensors, std::size_t noutputs)
 
TF_Code RunSession (TF_Session *session, const std::vector< TF_Output > &inputs, const std::vector< TF_Tensor * > &input_tensors, const std::vector< TF_Output > &outputs, std::vector< TF_Tensor * > &output_tensors)
 
template<typename T >
TF_Tensor * CreateTensor (TF_DataType data_type, const std::vector< std::int64_t > &dims, const std::vector< T > &data)
 
TF_Tensor * CreateEmptyTensor (TF_DataType data_type, const std::int64_t *dims, std::size_t num_dims)
 
TF_Tensor * CreateEmptyTensor (TF_DataType data_type, const std::vector< std::int64_t > &dims)
 
void DeleteTensors (const std::vector< TF_Tensor * > &tensors)
 
void SetTensorsData (TF_Tensor *tensor, const void *data, std::size_t len)
 
template<typename T >
void SetTensorsData (TF_Tensor *tensor, const std::vector< T > &data)
 
template<typename T >
std::vector< TGetTensorsData (const TF_Tensor *tensor)
 
template<typename T >
std::vector< std::vector< T > > GetTensorsData (const std::vector< TF_Tensor * > &tensors)
 

Function Documentation

◆ DeallocateBuffer()

static void tf_utils::DeallocateBuffer ( void *  data,
size_t   
)
static

Definition at line 97 of file tf_utils.C.

Referenced by ReadBufferFromFile().

Here is the caller graph for this function:

◆ ReadBufferFromFile()

static TF_Buffer* tf_utils::ReadBufferFromFile ( const char *  file)
static

Definition at line 102 of file tf_utils.C.

References DeallocateBuffer().

Referenced by LoadGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadGraph()

TF_Graph * LoadGraph ( const char *  graphPath)

Definition at line 132 of file tf_utils.C.

References ReadBufferFromFile().

Here is the call graph for this function:

◆ DeleteSession()

void DeleteSession ( TF_Session *  session)

Definition at line 171 of file tf_utils.C.

◆ CreateTensor() [1/2]

TF_Tensor * CreateTensor ( TF_DataType  data_type,
const std::int64_t *  dims,
std::size_t  num_dims,
const void *  data,
std::size_t  len 
)

Definition at line 255 of file tf_utils.C.

Referenced by CreateTensor().

Here is the caller graph for this function:

◆ DeleteTensor()

void DeleteTensor ( TF_Tensor *  tensor)

Definition at line 299 of file tf_utils.C.

◆ DeleteGraph()

void tf_utils::DeleteGraph ( TF_Graph *  graph)

◆ CreateSession()

TF_Session* tf_utils::CreateSession ( TF_Graph *  graph)

◆ RunSession() [1/2]

TF_Code tf_utils::RunSession ( TF_Session *  session,
const TF_Output *  inputs,
TF_Tensor *const *  input_tensors,
std::size_t  ninputs,
const TF_Output *  outputs,
TF_Tensor **  output_tensors,
std::size_t  noutputs 
)

◆ RunSession() [2/2]

TF_Code tf_utils::RunSession ( TF_Session *  session,
const std::vector< TF_Output > &  inputs,
const std::vector< TF_Tensor * > &  input_tensors,
const std::vector< TF_Output > &  outputs,
std::vector< TF_Tensor * > &  output_tensors 
)

◆ CreateTensor() [2/2]

TF_Tensor* tf_utils::CreateTensor ( TF_DataType  data_type,
const std::vector< std::int64_t > &  dims,
const std::vector< T > &  data 
)

Definition at line 75 of file tf_utils.H.

References CreateTensor(), and T.

Here is the call graph for this function:

◆ CreateEmptyTensor() [1/2]

TF_Tensor* tf_utils::CreateEmptyTensor ( TF_DataType  data_type,
const std::int64_t *  dims,
std::size_t  num_dims 
)

◆ CreateEmptyTensor() [2/2]

TF_Tensor* tf_utils::CreateEmptyTensor ( TF_DataType  data_type,
const std::vector< std::int64_t > &  dims 
)

◆ DeleteTensors()

void tf_utils::DeleteTensors ( const std::vector< TF_Tensor * > &  tensors)

◆ SetTensorsData() [1/2]

void tf_utils::SetTensorsData ( TF_Tensor *  tensor,
const void *  data,
std::size_t  len 
)

Referenced by SetTensorsData().

Here is the caller graph for this function:

◆ SetTensorsData() [2/2]

void tf_utils::SetTensorsData ( TF_Tensor *  tensor,
const std::vector< T > &  data 
)

Definition at line 95 of file tf_utils.H.

References SetTensorsData(), and T.

Here is the call graph for this function:

◆ GetTensorsData() [1/2]

std::vector<T> tf_utils::GetTensorsData ( const TF_Tensor *  tensor)

Definition at line 101 of file tf_utils.H.

References T.

◆ GetTensorsData() [2/2]

std::vector<std::vector<T> > tf_utils::GetTensorsData ( const std::vector< TF_Tensor * > &  tensors)

Definition at line 113 of file tf_utils.H.