ONE - On-device Neural Engine
|
#include <Runner.h>
Public Types | |
enum class | DataType { Unknown , U8 , U16 , U32 , U64 , S8 , S16 , S32 , S64 , FLOAT } |
Public Member Functions | |
Runner (const char *pb_path) | |
~Runner () | |
bool | getTensorShapeFromGraphDef (const std::unique_ptr< ParsedTensor > &tensor, angkor::TensorShape &shape) |
Get tensor shape from GraphDef for input tensor only. | |
bool | getTensorDtypeFromGraphDef (const std::unique_ptr< ParsedTensor > &tensor, Runner::DataType &dtype) |
Get tensor data type from GraphDef. | |
void | prepareInputs (const std::vector< std::unique_ptr< ParsedTensor > > &inputs, TensorDataMap &data_map) |
void | prepareOutputs (const std::vector< std::unique_ptr< ParsedTensor > > &outputs) |
void | run () |
const std::vector< TF_Tensor * > & | output () |
|
strong |
nnkit::support::tf::Runner::Runner | ( | const char * | pb_path | ) |
Definition at line 125 of file Runner.cpp.
nnkit::support::tf::Runner::~Runner | ( | ) |
Definition at line 148 of file Runner.cpp.
bool nnkit::support::tf::Runner::getTensorDtypeFromGraphDef | ( | const std::unique_ptr< ParsedTensor > & | tensor, |
Runner::DataType & | dtype | ||
) |
Get tensor data type from GraphDef.
Definition at line 195 of file Runner.cpp.
bool nnkit::support::tf::Runner::getTensorShapeFromGraphDef | ( | const std::unique_ptr< ParsedTensor > & | tensor, |
angkor::TensorShape & | shape | ||
) |
Get tensor shape from GraphDef for input tensor only.
Definition at line 168 of file Runner.cpp.
References nncc::core::ADT::tensor::Shape::dim(), and nncc::core::ADT::tensor::Shape::resize().
Referenced by nnkit::support::tf::Backend::Backend().
|
inline |
Definition at line 86 of file Runner.h.
Referenced by nnkit::support::tf::Backend::run().
void nnkit::support::tf::Runner::prepareInputs | ( | const std::vector< std::unique_ptr< ParsedTensor > > & | inputs, |
TensorDataMap & | data_map | ||
) |
Definition at line 242 of file Runner.cpp.
References nnkit::support::tf::TensorDataMap::data(), size, and TF_FLOAT.
Referenced by nnkit::support::tf::Backend::prepare().
void nnkit::support::tf::Runner::prepareOutputs | ( | const std::vector< std::unique_ptr< ParsedTensor > > & | outputs | ) |
Definition at line 274 of file Runner.cpp.
Referenced by nnkit::support::tf::Backend::prepare().
void nnkit::support::tf::Runner::run | ( | ) |
Definition at line 292 of file Runner.cpp.
Referenced by package.infer.session::inference(), and nnkit::support::tf::Backend::run().