ONE - On-device Neural Engine
|
Data Structures | |
class | NNFW_SESSION |
struct | tensorinfo |
tensor info describes the type and shape of tensors More... | |
Functions | |
void | ensure_status (NNFW_STATUS status) |
Handle errors with NNFW_STATUS in API functions. | |
NNFW_LAYOUT | getLayout (const char *layout="") |
NNFW_TYPE | getType (const char *type="") |
const char * | getStringType (NNFW_TYPE type) |
uint64_t | num_elems (const nnfw_tensorinfo *tensor_info) |
Get the total number of elements in nnfw_tensorinfo->dims. | |
py::list | get_dims (const tensorinfo &tensor_info) |
Get nnfw_tensorinfo->dims. | |
void | set_dims (tensorinfo &tensor_info, const py::list &array) |
Set nnfw_tensorinfo->dims. | |
void | bind_nnfw_session (pybind11::module_ &m) |
void | bind_experimental_nnfw_session (pybind11::module_ &m) |
void | bind_tensorinfo (pybind11::module_ &m) |
void | bind_nnfw_session (py::module_ &m) |
void | bind_experimental_nnfw_session (py::module_ &m) |
void | bind_tensorinfo (py::module_ &m) |
void onert::api::python::bind_experimental_nnfw_session | ( | py::module_ & | m | ) |
Definition at line 229 of file nnfw_session_bindings.cc.
References m, onert::api::python::NNFW_SESSION::train(), onert::api::python::NNFW_SESSION::train_export_checkpoint(), onert::api::python::NNFW_SESSION::train_export_circle(), onert::api::python::NNFW_SESSION::train_get_loss(), onert::api::python::NNFW_SESSION::train_get_traininfo(), onert::api::python::NNFW_SESSION::train_import_checkpoint(), onert::api::python::NNFW_SESSION::train_prepare(), and onert::api::python::NNFW_SESSION::train_set_traininfo().
void onert::api::python::bind_experimental_nnfw_session | ( | pybind11::module_ & | m | ) |
Referenced by PYBIND11_MODULE().
void onert::api::python::bind_nnfw_session | ( | py::module_ & | m | ) |
Definition at line 31 of file nnfw_session_bindings.cc.
References onert::api::python::NNFW_SESSION::input_size(), onert::api::python::NNFW_SESSION::input_tensorinfo(), m, onert::api::python::NNFW_SESSION::output_size(), onert::api::python::NNFW_SESSION::output_tensorinfo(), onert::api::python::NNFW_SESSION::prepare(), onert::api::python::NNFW_SESSION::run(), onert::api::python::NNFW_SESSION::run_async(), onert::api::python::NNFW_SESSION::set_input_layout(), onert::api::python::NNFW_SESSION::set_input_tensorinfo(), onert::api::python::NNFW_SESSION::set_output_layout(), and onert::api::python::NNFW_SESSION::wait().
void onert::api::python::bind_nnfw_session | ( | pybind11::module_ & | m | ) |
Referenced by PYBIND11_MODULE().
void onert::api::python::bind_tensorinfo | ( | py::module_ & | m | ) |
Definition at line 31 of file nnfw_tensorinfo_bindings.cc.
References onert::api::python::tensorinfo::dtype, get_dims(), m, onert::api::python::tensorinfo::rank, and set_dims().
void onert::api::python::bind_tensorinfo | ( | pybind11::module_ & | m | ) |
Referenced by PYBIND11_MODULE().
void onert::api::python::ensure_status | ( | NNFW_STATUS | status | ) |
Handle errors with NNFW_STATUS in API functions.
This only handles NNFW_STATUS errors.
[in] | status | The status returned by API functions |
Definition at line 30 of file nnfw_api_wrapper.cc.
References NNFW_STATUS_DEPRECATED_API, NNFW_STATUS_ERROR, NNFW_STATUS_INSUFFICIENT_OUTPUT_SIZE, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, NNFW_STATUS_OUT_OF_MEMORY, and NNFW_STATUS_UNEXPECTED_NULL.
Referenced by onert::api::python::NNFW_SESSION::close_session(), onert::api::python::NNFW_SESSION::input_size(), onert::api::python::NNFW_SESSION::input_tensorinfo(), onert::api::python::NNFW_SESSION::NNFW_SESSION(), onert::api::python::NNFW_SESSION::output_size(), onert::api::python::NNFW_SESSION::output_tensorinfo(), onert::api::python::NNFW_SESSION::prepare(), onert::api::python::NNFW_SESSION::run(), onert::api::python::NNFW_SESSION::run_async(), onert::api::python::NNFW_SESSION::set_input(), onert::api::python::NNFW_SESSION::set_input_layout(), onert::api::python::NNFW_SESSION::set_input_tensorinfo(), onert::api::python::NNFW_SESSION::set_output(), onert::api::python::NNFW_SESSION::set_output_layout(), onert::api::python::NNFW_SESSION::train(), onert::api::python::NNFW_SESSION::train_export_checkpoint(), onert::api::python::NNFW_SESSION::train_export_circle(), onert::api::python::NNFW_SESSION::train_get_loss(), onert::api::python::NNFW_SESSION::train_get_traininfo(), onert::api::python::NNFW_SESSION::train_import_checkpoint(), onert::api::python::NNFW_SESSION::train_prepare(), onert::api::python::NNFW_SESSION::train_set_expected(), onert::api::python::NNFW_SESSION::train_set_input(), onert::api::python::NNFW_SESSION::train_set_output(), onert::api::python::NNFW_SESSION::train_set_traininfo(), and onert::api::python::NNFW_SESSION::wait().
py::list onert::api::python::get_dims | ( | const tensorinfo & | tensor_info | ) |
Get nnfw_tensorinfo->dims.
This function is called to get dimension array of tensorinfo.
[in] | tensor_info | Tensor info (shape, type, etc) |
Definition at line 151 of file nnfw_api_wrapper.cc.
References onert::api::python::tensorinfo::dims, and onert::api::python::tensorinfo::rank.
Referenced by bind_tensorinfo().
NNFW_LAYOUT onert::api::python::getLayout | ( | const char * | layout = "" | ) |
Convert the layout with string to NNFW_LAYOUT
[in] | layout | layout to be converted |
Definition at line 57 of file nnfw_api_wrapper.cc.
References NNFW_LAYOUT_CHANNELS_FIRST, NNFW_LAYOUT_CHANNELS_LAST, and NNFW_LAYOUT_NONE.
Referenced by onert::api::python::NNFW_SESSION::set_input_layout(), and onert::api::python::NNFW_SESSION::set_output_layout().
const char * onert::api::python::getStringType | ( | NNFW_TYPE | type | ) |
Convert the type with NNFW_TYPE to string
[in] | type | type to be converted |
Definition at line 116 of file nnfw_api_wrapper.cc.
References NNFW_TYPE_TENSOR_FLOAT32, and NNFW_TYPE_TENSOR_INT32.
Referenced by onert::api::python::NNFW_SESSION::input_tensorinfo(), and onert::api::python::NNFW_SESSION::output_tensorinfo().
NNFW_TYPE onert::api::python::getType | ( | const char * | type = "" | ) |
Convert the type with string to NNFW_TYPE
[in] | type | type to be converted |
Definition at line 78 of file nnfw_api_wrapper.cc.
References NNFW_TYPE_TENSOR_FLOAT32, and NNFW_TYPE_TENSOR_INT32.
Referenced by onert::api::python::NNFW_SESSION::set_input_tensorinfo().
uint64_t onert::api::python::num_elems | ( | const nnfw_tensorinfo * | tensor_info | ) |
Get the total number of elements in nnfw_tensorinfo->dims.
This function is called to set the size of the input, output array.
[in] | tensor_info | Tensor info (shape, type, etc) |
Definition at line 141 of file nnfw_api_wrapper.cc.
References nnfw_tensorinfo::dims, and nnfw_tensorinfo::rank.
Referenced by onert::api::python::NNFW_SESSION::set_input(), onert::api::python::NNFW_SESSION::set_output(), and onert::api::python::NNFW_SESSION::train_set_output().
void onert::api::python::set_dims | ( | tensorinfo & | tensor_info, |
const py::list & | array | ||
) |
Set nnfw_tensorinfo->dims.
This function is called to set dimension array of tensorinfo.
[in] | tensor_info | Tensor info (shape, type, etc) |
[in] | array | array to set dimension |
Definition at line 161 of file nnfw_api_wrapper.cc.
References onert::api::python::tensorinfo::dims, and onert::api::python::tensorinfo::rank.
Referenced by bind_tensorinfo().