ONE - On-device Neural Engine
|
Go to the source code of this file.
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 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 21 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 NNFW_SESSION::close_session(), NNFW_SESSION::input_size(), NNFW_SESSION::input_tensorinfo(), NNFW_SESSION::NNFW_SESSION(), NNFW_SESSION::output_size(), NNFW_SESSION::output_tensorinfo(), NNFW_SESSION::run(), NNFW_SESSION::run_async(), NNFW_SESSION::set_input(), NNFW_SESSION::set_input_layout(), NNFW_SESSION::set_input_tensorinfo(), NNFW_SESSION::set_output(), NNFW_SESSION::set_output_layout(), and NNFW_SESSION::wait().
py::list 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 142 of file nnfw_api_wrapper.cc.
References tensorinfo::dims, and tensorinfo::rank.
Referenced by PYBIND11_MODULE().
NNFW_LAYOUT getLayout | ( | const char * | layout = "" | ) |
Convert the layout with string to NNFW_LAYOUT
[in] | layout | layout to be converted |
Definition at line 48 of file nnfw_api_wrapper.cc.
References NNFW_LAYOUT_CHANNELS_FIRST, NNFW_LAYOUT_CHANNELS_LAST, and NNFW_LAYOUT_NONE.
Referenced by NNFW_SESSION::set_input_layout(), and NNFW_SESSION::set_output_layout().
const char * getStringType | ( | NNFW_TYPE | type | ) |
Convert the type with NNFW_TYPE to string
[in] | type | type to be converted |
Definition at line 107 of file nnfw_api_wrapper.cc.
References NNFW_TYPE_TENSOR_FLOAT32, and NNFW_TYPE_TENSOR_INT32.
Referenced by NNFW_SESSION::input_tensorinfo(), and NNFW_SESSION::output_tensorinfo().
NNFW_TYPE getType | ( | const char * | type = "" | ) |
Convert the type with string to NNFW_TYPE
[in] | type | type to be converted |
Definition at line 69 of file nnfw_api_wrapper.cc.
References NNFW_TYPE_TENSOR_FLOAT32, and NNFW_TYPE_TENSOR_INT32.
Referenced by mir_onnx::convertExpandV8(), mir::Operation::Output::getElementType(), mir::Operation::Output::getShape(), and NNFW_SESSION::set_input_tensorinfo().
uint64_t 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 132 of file nnfw_api_wrapper.cc.
void 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 152 of file nnfw_api_wrapper.cc.
References tensorinfo::dims, and tensorinfo::rank.
Referenced by PYBIND11_MODULE().