ONE - On-device Neural Engine
|
#include <nnfw_api_wrapper.h>
Public Member Functions | |
NNFW_SESSION (const char *package_file_path, const char *backends) | |
~NNFW_SESSION () | |
void | close_session () |
void | set_input_tensorinfo (uint32_t index, const tensorinfo *tensor_info) |
void | run () |
void | run_async () |
void | wait () |
template<typename T > | |
void | set_input (uint32_t index, py::array_t< T > &buffer) |
process input array according to data type of numpy array sent by Python (int, float, uint8_t, bool, int64_t, int8_t, int16_t) | |
template<typename T > | |
void | set_output (uint32_t index, py::array_t< T > &buffer) |
process output array according to data type of numpy array sent by Python (int, float, uint8_t, bool, int64_t, int8_t, int16_t) | |
uint32_t | input_size () |
uint32_t | output_size () |
void | set_input_layout (uint32_t index, const char *layout) |
void | set_output_layout (uint32_t index, const char *layout) |
tensorinfo | input_tensorinfo (uint32_t index) |
tensorinfo | output_tensorinfo (uint32_t index) |
Definition at line 112 of file nnfw_api_wrapper.h.
NNFW_SESSION::NNFW_SESSION | ( | const char * | package_file_path, |
const char * | backends | ||
) |
Definition at line 161 of file nnfw_api_wrapper.cc.
References ensure_status(), nnfw_create_session(), nnfw_load_model_from_file(), nnfw_prepare(), and nnfw_set_available_backends().
NNFW_SESSION::~NNFW_SESSION | ( | ) |
Definition at line 169 of file nnfw_api_wrapper.cc.
References close_session().
void NNFW_SESSION::close_session | ( | ) |
Definition at line 177 of file nnfw_api_wrapper.cc.
References ensure_status(), and nnfw_close_session().
Referenced by ~NNFW_SESSION().
uint32_t NNFW_SESSION::input_size | ( | ) |
Definition at line 196 of file nnfw_api_wrapper.cc.
References ensure_status(), and nnfw_input_size().
Referenced by PYBIND11_MODULE().
tensorinfo NNFW_SESSION::input_tensorinfo | ( | uint32_t | index | ) |
Definition at line 220 of file nnfw_api_wrapper.cc.
References nnfw_tensorinfo::dims, tensorinfo::dims, nnfw_tensorinfo::dtype, tensorinfo::dtype, ensure_status(), getStringType(), nnfw_input_tensorinfo(), NNFW_MAX_RANK, nnfw_tensorinfo::rank, and tensorinfo::rank.
Referenced by PYBIND11_MODULE(), and package.infer.session::set_inputs().
uint32_t NNFW_SESSION::output_size | ( | ) |
Definition at line 203 of file nnfw_api_wrapper.cc.
References ensure_status(), and nnfw_output_size().
Referenced by PYBIND11_MODULE().
tensorinfo NNFW_SESSION::output_tensorinfo | ( | uint32_t | index | ) |
Definition at line 233 of file nnfw_api_wrapper.cc.
References nnfw_tensorinfo::dims, tensorinfo::dims, nnfw_tensorinfo::dtype, tensorinfo::dtype, ensure_status(), getStringType(), NNFW_MAX_RANK, nnfw_output_tensorinfo(), nnfw_tensorinfo::rank, and tensorinfo::rank.
Referenced by PYBIND11_MODULE(), and package.infer.session::set_outputs().
void NNFW_SESSION::run | ( | ) |
Definition at line 193 of file nnfw_api_wrapper.cc.
References ensure_status(), and nnfw_run().
Referenced by package.infer.session::inference(), and PYBIND11_MODULE().
void NNFW_SESSION::run_async | ( | ) |
Definition at line 194 of file nnfw_api_wrapper.cc.
References ensure_status(), and nnfw_run_async().
Referenced by PYBIND11_MODULE().
|
inline |
process input array according to data type of numpy array sent by Python (int, float, uint8_t, bool, int64_t, int8_t, int16_t)
Definition at line 130 of file nnfw_api_wrapper.h.
References nnfw_tensorinfo::dtype, ensure_status(), nnfw_input_tensorinfo(), nnfw_set_input(), and num_elems().
Referenced by package.infer.session::set_inputs().
void NNFW_SESSION::set_input_layout | ( | uint32_t | index, |
const char * | layout | ||
) |
Definition at line 210 of file nnfw_api_wrapper.cc.
References ensure_status(), getLayout(), and nnfw_set_input_layout().
Referenced by PYBIND11_MODULE().
void NNFW_SESSION::set_input_tensorinfo | ( | uint32_t | index, |
const tensorinfo * | tensor_info | ||
) |
Definition at line 182 of file nnfw_api_wrapper.cc.
References nnfw_tensorinfo::dims, tensorinfo::dims, nnfw_tensorinfo::dtype, tensorinfo::dtype, ensure_status(), getType(), NNFW_MAX_RANK, nnfw_set_input_tensorinfo(), nnfw_tensorinfo::rank, and tensorinfo::rank.
Referenced by PYBIND11_MODULE().
|
inline |
process output array according to data type of numpy array sent by Python (int, float, uint8_t, bool, int64_t, int8_t, int16_t)
Definition at line 144 of file nnfw_api_wrapper.h.
References nnfw_tensorinfo::dtype, ensure_status(), nnfw_output_tensorinfo(), nnfw_set_output(), and num_elems().
Referenced by package.infer.session::set_outputs().
void NNFW_SESSION::set_output_layout | ( | uint32_t | index, |
const char * | layout | ||
) |
Definition at line 215 of file nnfw_api_wrapper.cc.
References ensure_status(), getLayout(), and nnfw_set_output_layout().
Referenced by PYBIND11_MODULE().
void NNFW_SESSION::wait | ( | ) |
Definition at line 195 of file nnfw_api_wrapper.cc.
References ensure_status(), and nnfw_await().
Referenced by PYBIND11_MODULE().