ONE - On-device Neural Engine
|
#include "nnfw.h"
Go to the source code of this file.
Functions | |
NNFW_STATUS | nnfw_set_config (nnfw_session *session, const char *key, const char *value) |
NNFW_STATUS | nnfw_get_config (nnfw_session *session, const char *key, char *value, size_t value_size) |
NNFW_STATUS | nnfw_load_circle_from_buffer (nnfw_session *session, uint8_t *buffer, size_t size) |
Load a circle model from buffer. | |
NNFW_STATUS | nnfw_train_export_circleplus (nnfw_session *session, const char *file_path) |
Export circle+ model. | |
NNFW_STATUS | nnfw_get_output (nnfw_session *session, uint32_t index, nnfw_tensorinfo *out_info, const void **out_buffer) |
Python-binding-only API to retrieve a read-only output buffer and its tensor info. | |
NNFW_STATUS nnfw_get_config | ( | nnfw_session * | session, |
const char * | key, | ||
char * | value, | ||
size_t | value_size | ||
) |
Definition at line 36 of file nnfw_internal.cc.
References NNFW_RETURN_ERROR_IF_NULL.
NNFW_STATUS nnfw_get_output | ( | nnfw_session * | session, |
uint32_t | index, | ||
nnfw_tensorinfo * | out_info, | ||
const void ** | out_buffer | ||
) |
Python-binding-only API to retrieve a read-only output buffer and its tensor info.
After nnfw_run has been called, the session has already resized or allocated the internal output buffer to match the latest output dimensions. This API simply retrieves that internal buffer pointer and the corresponding tensor info without performing any allocation itself.
Note: this function is intended for Python binding only. The buffer is managed internally by the session and must not be modified by the caller. In Python, wrap the pointer as a NumPy array and set array.flags.writeable = False to enforce read-only access.
Important: To use this API, you must call nnfw_set_prepare_config(session, NNFW_ENABLE_INTERNAL_OUTPUT_ALLOC, "true") before calling nnfw_prepare().
[in] | session | The session object |
[in] | index | Output tensor index |
[out] | out_info | nnfw_tensorinfo to be filled with the latest shape/type information |
[out] | out_buffer | Pointer to a const buffer managed by the session |
Definition at line 54 of file nnfw_internal.cc.
References NNFW_RETURN_ERROR_IF_NULL.
Referenced by onert::api::python::NNFW_SESSION::get_output().
NNFW_STATUS nnfw_load_circle_from_buffer | ( | nnfw_session * | session, |
uint8_t * | buffer, | ||
size_t | size | ||
) |
Load a circle model from buffer.
The buffer must outlive the session.
[in] | session | session |
[in] | buffer | Pointer to the buffer |
[in] | size | Buffer size |
Definition at line 42 of file nnfw_internal.cc.
References NNFW_RETURN_ERROR_IF_NULL, and size.
NNFW_STATUS nnfw_set_config | ( | nnfw_session * | session, |
const char * | key, | ||
const char * | value | ||
) |
Definition at line 30 of file nnfw_internal.cc.
References NNFW_RETURN_ERROR_IF_NULL.
NNFW_STATUS nnfw_train_export_circleplus | ( | nnfw_session * | session, |
const char * | file_path | ||
) |
Export circle+ model.
nnfw_train
[in] | session | The session to export training model |
[in] | file_path | The path to export training model |
NNFW_STATUS_NO_ERROR
if successful Definition at line 48 of file nnfw_internal.cc.
References NNFW_RETURN_ERROR_IF_NULL.