163#define NNFW_MAX_RANK (6)
348 const void *buffer,
size_t length);
NNFW_STATUS nnfw_create_session(nnfw_session **session)
Create a new session instance.
NNFW_STATUS nnfw_load_model_from_file(nnfw_session *session, const char *path)
Load model from path to model or nnpackage.
NNFW_STATUS
Result values returned from a call to an API function.
@ NNFW_STATUS_INVALID_STATE
@ NNFW_STATUS_UNEXPECTED_NULL
@ NNFW_STATUS_DEPRECATED_API
@ NNFW_STATUS_INSUFFICIENT_OUTPUT_SIZE
@ NNFW_STATUS_OUT_OF_MEMORY
NNFW_STATUS nnfw_set_input(nnfw_session *session, uint32_t index, NNFW_TYPE type, const void *buffer, size_t length)
Set input buffer.
NNFW_STATUS nnfw_await(nnfw_session *session)
Wait for asynchronous run to finish.
NNFW_STATUS nnfw_apply_tensorinfo(nnfw_session *session, uint32_t index, nnfw_tensorinfo tensor_info)
Apply i-th input's tensor info to resize input tensor.
NNFW_STATUS nnfw_close_session(nnfw_session *session)
Close a session instance.
NNFW_STATUS nnfw_query_info_u32(nnfw_session *session, NNFW_INFO_ID id, uint32_t *val)
Retrieve uint32 type of nnfw information for given information ID.
NNFW_STATUS nnfw_run_async(nnfw_session *session)
Run inference asynchronously.
NNFW_STATUS nnfw_output_tensorinfo(nnfw_session *session, uint32_t index, nnfw_tensorinfo *tensor_info)
Get i-th output tensor info.
NNFW_STATUS nnfw_set_available_backends(nnfw_session *session, const char *backends)
Set available backends.
NNFW_STATUS nnfw_input_tensorinfo(nnfw_session *session, uint32_t index, nnfw_tensorinfo *tensor_info)
Get i-th input tensor info.
NNFW_STATUS nnfw_output_size(nnfw_session *session, uint32_t *number)
Get the number of outputs.
NNFW_INFO_ID
Information ID for retrieving information on nnfw (e.g. version)
NNFW_STATUS nnfw_set_workspace(nnfw_session *session, const char *dir)
Set runtime's workspace directory.
NNFW_STATUS nnfw_input_size(nnfw_session *session, uint32_t *number)
Get the number of inputs.
NNFW_STATUS nnfw_set_input_tensorinfo(nnfw_session *session, uint32_t index, const nnfw_tensorinfo *tensor_info)
Set input model's tensor info for resizing.
NNFW_STATUS nnfw_run(nnfw_session *session)
Run inference.
NNFW_STATUS nnfw_prepare(nnfw_session *session)
Prepare session to be ready for inference.
NNFW_STATUS nnfw_set_output(nnfw_session *session, uint32_t index, NNFW_TYPE type, void *buffer, size_t length)
Set output buffer.
NNFW_STATUS nnfw_set_op_backend(nnfw_session *session, const char *op, const char *backend)
Set the operation's backend.
@ NNFW_TYPE_TENSOR_QUANT16_SYMM_SIGNED
@ NNFW_TYPE_TENSOR_QUANT8_ASYMM_SIGNED
@ NNFW_TYPE_TENSOR_QUANT8_ASYMM
@ NNFW_TYPE_TENSOR_FLOAT32
#define NNFW_MAX_RANK
Maximum rank expressible with nnfw.
NNFW_STATUS nnfw_set_output_layout(nnfw_session *session, uint32_t index, NNFW_LAYOUT layout)
Set the layout of an output.
NNFW_LAYOUT
Data format of a tensor.
@ NNFW_LAYOUT_CHANNELS_LAST
@ NNFW_LAYOUT_CHANNELS_FIRST
NNFW_STATUS nnfw_set_input_layout(nnfw_session *session, uint32_t index, NNFW_LAYOUT layout)
Set the layout of an input.
NNFW_STATUS
Result values returned from a call to an API function.
tensor info describes the type and shape of tensors
int32_t dims[NNFW_MAX_RANK]