ONE - On-device Neural Engine
|
#include <nnfw_session.h>
Static Public Member Functions | |
static NNFW_STATUS | create (nnfw_session **session) |
Factory method. It creates and initialize nnfw_session. | |
static NNFW_STATUS | create (nnfw_session **session) |
Factory method. It creates and initialize nnfw_session. | |
static NNFW_STATUS | deprecated (const char *msg) |
Definition at line 68 of file onert-micro.cpp.
|
default |
Definition at line 165 of file onert-micro.cpp.
nnfw_session::~nnfw_session | ( | ) |
NNFW_STATUS nnfw_session::await | ( | ) |
Definition at line 508 of file nnfw_session.cc.
References NNFW_STATUS_ERROR, and NNFW_STATUS_NO_ERROR.
NNFW_STATUS nnfw_session::codegen | ( | const char * | target, |
NNFW_CODEGEN_PREF | pref | ||
) |
Definition at line 1868 of file nnfw_session.cc.
References onert::odc::CODEGEN_PREF_COMPILE_TIME_FIRST, onert::odc::CODEGEN_PREF_DEFAULT, onert::odc::CODEGEN_PREF_MEMORY_FIRST, onert::odc::CODEGEN_PREF_PERFORMANCE_FIRST, NNFW_CODEGEN_PREF_COMPILE_TIME_FIRST, NNFW_CODEGEN_PREF_DEFAULT, NNFW_CODEGEN_PREF_MEMORY_FIRST, NNFW_CODEGEN_PREF_PERFORMANCE_FIRST, NNFW_STATUS_ERROR, and NNFW_STATUS_INVALID_STATE.
Referenced by run_with_auto_compilation().
|
static |
Factory method. It creates and initialize nnfw_session.
Definition at line 149 of file onert-micro.cpp.
References NNFW_STATUS_ERROR, NNFW_STATUS_NO_ERROR, and NNFW_STATUS_UNEXPECTED_NULL.
Referenced by nnfw_create_session().
|
static |
Factory method. It creates and initialize nnfw_session.
NNFW_STATUS nnfw_session::delete_odc_minmax_file | ( | ) |
Definition at line 2024 of file nnfw_session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
|
static |
Definition at line 870 of file nnfw_session.cc.
References NNFW_STATUS_DEPRECATED_API.
Referenced by nnfw_apply_tensorinfo(), nnfw_pop_pipeline_output(), nnfw_prepare_pipeline(), nnfw_push_pipeline_input(), and nnfw_set_op_backend().
NNFW_STATUS nnfw_session::get_config | ( | const char * | key, |
char * | value, | ||
size_t | value_size | ||
) |
Definition at line 971 of file nnfw_session.cc.
References nnfw::misc::join(), NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and NNFW_STATUS_UNEXPECTED_NULL.
NNFW_STATUS nnfw_session::input_size | ( | uint32_t * | number | ) |
Definition at line 588 of file nnfw_session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and NNFW_STATUS_UNEXPECTED_NULL.
Referenced by run_with_auto_compilation().
NNFW_STATUS nnfw_session::input_tensorindex | ( | const char * | tensorname, |
uint32_t * | index | ||
) |
Definition at line 1090 of file nnfw_session.cc.
NNFW_STATUS nnfw_session::input_tensorinfo | ( | uint32_t | index, |
nnfw_tensorinfo * | ti | ||
) |
Definition at line 739 of file nnfw_session.cc.
References info, NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and NNFW_STATUS_UNEXPECTED_NULL.
Referenced by run_with_auto_compilation(), package.infer.session::set_inputs(), and train_set_input().
NNFW_STATUS nnfw_session::load_circle_from_buffer | ( | uint8_t * | buffer, |
size_t | size | ||
) |
Definition at line 277 of file nnfw_session.cc.
References onert::loader::loadCircleModel(), NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, NNFW_STATUS_UNEXPECTED_NULL, and size.
NNFW_STATUS nnfw_session::load_model_from_file | ( | const char * | package_file_path | ) |
Definition at line 272 of file onert-micro.cpp.
References onert_micro::OMTrainingInterpreter::importTrainModel(), onert_micro::OMConfig::model_ptr, onert_micro::OMConfig::model_size, NNFW_STATUS_NO_ERROR, and readFile().
NNFW_STATUS nnfw_session::load_model_from_path | ( | const char * | path | ) |
Definition at line 304 of file nnfw_session.cc.
References onert::util::Index< uint16_t, ModelIndexTag >::max(), MAX_PATH_LENGTH, NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, NNFW_STATUS_UNEXPECTED_NULL, onert::util::setConfigKeyValues(), and nnfw::misc::split().
NNFW_STATUS nnfw_session::output_size | ( | uint32_t * | number | ) |
Definition at line 610 of file nnfw_session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and NNFW_STATUS_UNEXPECTED_NULL.
Referenced by run_with_auto_compilation().
NNFW_STATUS nnfw_session::output_tensorindex | ( | const char * | tensorname, |
uint32_t * | index | ||
) |
Definition at line 1095 of file nnfw_session.cc.
NNFW_STATUS nnfw_session::output_tensorinfo | ( | uint32_t | index, |
nnfw_tensorinfo * | ti | ||
) |
Definition at line 781 of file nnfw_session.cc.
References info, NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and NNFW_STATUS_UNEXPECTED_NULL.
Referenced by run_with_auto_compilation(), and package.infer.session::set_outputs().
NNFW_STATUS nnfw_session::prepare | ( | ) |
Definition at line 429 of file nnfw_session.cc.
References onert::compiler::CompilerFactory::create(), onert::compiler::CompilerFactory::get(), NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
Referenced by run_with_auto_compilation().
NNFW_STATUS nnfw_session::quantize | ( | ) |
Definition at line 1821 of file nnfw_session.cc.
References NNFW_STATUS_ERROR, and NNFW_STATUS_INVALID_STATE.
NNFW_STATUS nnfw_session::register_custom_operation | ( | const std::string & | id, |
nnfw_custom_eval | eval_func | ||
) |
Definition at line 824 of file nnfw_session.cc.
References NNFW_STATUS_NO_ERROR.
NNFW_STATUS nnfw_session::reset_execute_config | ( | ) |
Definition at line 1995 of file nnfw_session.cc.
References NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
NNFW_STATUS nnfw_session::reset_prepare_config | ( | ) |
Definition at line 1952 of file nnfw_session.cc.
References NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
NNFW_STATUS nnfw_session::run | ( | ) |
Definition at line 464 of file nnfw_session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INSUFFICIENT_OUTPUT_SIZE, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and onert::OnertException::what().
Referenced by package.infer.session::inference().
NNFW_STATUS nnfw_session::run_async | ( | ) |
Definition at line 493 of file nnfw_session.cc.
References NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
NNFW_STATUS nnfw_session::run_with_auto_compilation | ( | const char * | target, |
NNFW_CODEGEN_PREF | pref | ||
) |
Definition at line 2039 of file nnfw_session.cc.
References codegen(), nnfw_tensorinfo::dtype, input_size(), input_tensorinfo(), NNFW_STATUS_ERROR, NNFW_STATUS_INSUFFICIENT_OUTPUT_SIZE, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, NNFW_TYPE_TENSOR_FLOAT32, output_size(), output_tensorinfo(), prepare(), set_input(), set_output(), and onert::OnertException::what().
NNFW_STATUS nnfw_session::set_available_backends | ( | const char * | backends | ) |
Definition at line 831 of file nnfw_session.cc.
References MAX_BACKEND_NAME_LENGTH, NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, NNFW_STATUS_UNEXPECTED_NULL, and nnfw::misc::split().
NNFW_STATUS nnfw_session::set_backends_per_operation | ( | const char * | backend_settings | ) |
Set backends with string-encoded mapping from operation index to backend type (cpu, acl_cl)
Definition at line 1100 of file nnfw_session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
NNFW_STATUS nnfw_session::set_codegen_model_path | ( | const char * | path | ) |
Definition at line 1846 of file nnfw_session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
NNFW_STATUS nnfw_session::set_config | ( | const char * | key, |
const char * | value | ||
) |
Definition at line 876 of file nnfw_session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and NNFW_STATUS_UNEXPECTED_NULL.
NNFW_STATUS nnfw_session::set_execute_config | ( | const NNFW_RUN_CONFIG | key, |
const char * | value | ||
) |
Definition at line 1965 of file nnfw_session.cc.
References NNFW_RUN_CONFIG_DUMP_MINMAX, NNFW_RUN_CONFIG_PROFILE, NNFW_RUN_CONFIG_TRACE, NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
NNFW_STATUS nnfw_session::set_input | ( | uint32_t | index, |
NNFW_TYPE | type, | ||
const void * | buffer, | ||
size_t | length | ||
) |
Definition at line 523 of file nnfw_session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and NNFW_TYPE_TENSOR_FLOAT32.
Referenced by run_with_auto_compilation(), and package.infer.session::set_inputs().
NNFW_STATUS nnfw_session::set_input_layout | ( | uint32_t | index, |
NNFW_LAYOUT | layout | ||
) |
Definition at line 632 of file nnfw_session.cc.
References NNFW_LAYOUT_CHANNELS_FIRST, NNFW_LAYOUT_CHANNELS_LAST, NNFW_LAYOUT_NONE, NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
NNFW_STATUS nnfw_session::set_input_tensorinfo | ( | uint32_t | index, |
const nnfw_tensorinfo * | ti | ||
) |
Definition at line 689 of file nnfw_session.cc.
References nnfw_tensorinfo::dims, NNFW_MAX_RANK, NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, NNFW_STATUS_UNEXPECTED_NULL, and nnfw_tensorinfo::rank.
NNFW_STATUS nnfw_session::set_odc_param_minmax_records_count | ( | int | minmax_records_count | ) |
Definition at line 2010 of file nnfw_session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
NNFW_STATUS nnfw_session::set_output | ( | uint32_t | index, |
NNFW_TYPE | type, | ||
void * | buffer, | ||
size_t | length | ||
) |
Definition at line 556 of file nnfw_session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and NNFW_TYPE_TENSOR_FLOAT32.
Referenced by run_with_auto_compilation(), and package.infer.session::set_outputs().
NNFW_STATUS nnfw_session::set_output_layout | ( | uint32_t | index, |
NNFW_LAYOUT | layout | ||
) |
Definition at line 660 of file nnfw_session.cc.
References NNFW_LAYOUT_CHANNELS_FIRST, NNFW_LAYOUT_CHANNELS_LAST, NNFW_LAYOUT_NONE, NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
NNFW_STATUS nnfw_session::set_prepare_config | ( | const NNFW_PREPARE_CONFIG | key, |
const char * | value | ||
) |
Definition at line 1932 of file nnfw_session.cc.
References NNFW_PREPARE_CONFIG_PROFILE, NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
NNFW_STATUS nnfw_session::set_quantization_type | ( | NNFW_QUANTIZE_TYPE | qtype | ) |
Definition at line 1760 of file nnfw_session.cc.
References NNFW_QUANTIZE_TYPE_I16_SYM, NNFW_QUANTIZE_TYPE_U8_ASYM, NNFW_QUANTIZE_TYPE_WO_I16_SYM, NNFW_QUANTIZE_TYPE_WO_I8_SYM, NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, onert::odc::ODC_QTYPE_I16_SYM, onert::odc::ODC_QTYPE_NOT_SET, onert::odc::ODC_QTYPE_U8_ASYM, onert::odc::ODC_QTYPE_WO_I16_SYM, and onert::odc::ODC_QTYPE_WO_I8_SYM.
NNFW_STATUS nnfw_session::set_quantized_model_path | ( | const char * | path | ) |
Definition at line 1800 of file nnfw_session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
NNFW_STATUS nnfw_session::set_workspace | ( | const char * | dir | ) |
Definition at line 855 of file nnfw_session.cc.
References NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and NNFW_STATUS_UNEXPECTED_NULL.
NNFW_STATUS nnfw_session::train_expected_tensorinfo | ( | uint32_t | index, |
nnfw_tensorinfo * | ti | ||
) |
Definition at line 1409 of file nnfw_session.cc.
References NNFW_STATUS_ERROR, and NNFW_STATUS_INVALID_STATE.
NNFW_STATUS nnfw_session::train_expected_tensorinfo | ( | uint32_t | index, |
nnfw_tensorinfo * | ti | ||
) |
NNFW_STATUS nnfw_session::train_export_checkpoint | ( | const char * | path | ) |
Definition at line 324 of file onert-micro.cpp.
References NNFW_STATUS_NO_ERROR, and onert_micro::OMTrainingInterpreter::saveCheckpoint().
NNFW_STATUS nnfw_session::train_export_checkpoint | ( | const char * | path | ) |
NNFW_STATUS nnfw_session::train_export_circle | ( | const char * | path | ) |
Definition at line 318 of file onert-micro.cpp.
References NNFW_STATUS_NO_ERROR, and onert_micro::OMTrainingInterpreter::saveModel().
NNFW_STATUS nnfw_session::train_export_circle | ( | const char * | path | ) |
NNFW_STATUS nnfw_session::train_export_circleplus | ( | const char * | path | ) |
Definition at line 1647 of file nnfw_session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, NNFW_STATUS_UNEXPECTED_NULL, onert::exporter::CircleExporter::updateMetadata(), and onert::exporter::CircleExporter::updateWeight().
NNFW_STATUS nnfw_session::train_get_loss | ( | uint32_t | index, |
float * | loss | ||
) |
Definition at line 370 of file onert-micro.cpp.
References onert_micro::OMTrainingContext::batch_size, onert_micro::CROSS_ENTROPY, onert_micro::CROSS_ENTROPY_METRICS, onert_micro::OMTrainingInterpreter::evaluateMetric(), onert_micro::OMTrainingContext::loss, m, NNFW_STATUS_NO_ERROR, and onert_micro::OMConfig::training_context.
NNFW_STATUS nnfw_session::train_get_loss | ( | uint32_t | index, |
float * | loss | ||
) |
NNFW_STATUS nnfw_session::train_get_traininfo | ( | nnfw_train_info * | info | ) |
Definition at line 1131 of file nnfw_session.cc.
References onert::ir::train::Adam, onert::ir::train::CategoricalCrossentropy, info, onert::ir::train::MeanSquaredError, NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, NNFW_STATUS_UNEXPECTED_NULL, NNFW_TRAIN_LOSS_CATEGORICAL_CROSSENTROPY, NNFW_TRAIN_LOSS_MEAN_SQUARED_ERROR, NNFW_TRAIN_LOSS_REDUCTION_SUM, NNFW_TRAIN_LOSS_REDUCTION_SUM_OVER_BATCH_SIZE, NNFW_TRAIN_LOSS_REDUCTION_UNDEFINED, NNFW_TRAIN_LOSS_UNDEFINED, NNFW_TRAIN_OPTIMIZER_ADAM, NNFW_TRAIN_OPTIMIZER_SGD, NNFW_TRAIN_OPTIMIZER_UNDEFINED, NNFW_TRAIN_TRAINABLE_ALL, NNFW_TRAIN_TRAINABLE_INCORRECT_STATE, NNFW_TRAIN_TRAINABLE_NONE, onert::ir::IGraph::operations(), onert::ir::train::SGD, onert::util::ObjectManager< Index, Object >::size(), onert::ir::train::Sum, onert::ir::train::SumOverBatchSize, and onert::ir::train::Undefined.
NNFW_STATUS nnfw_session::train_import_checkpoint | ( | const char * | path | ) |
Definition at line 330 of file onert-micro.cpp.
References onert_micro::OMTrainingInterpreter::loadCheckpoint(), and NNFW_STATUS_NO_ERROR.
NNFW_STATUS nnfw_session::train_import_checkpoint | ( | const char * | path | ) |
NNFW_STATUS nnfw_session::train_input_tensorinfo | ( | uint32_t | index, |
nnfw_tensorinfo * | ti | ||
) |
Definition at line 1393 of file nnfw_session.cc.
References NNFW_STATUS_ERROR, and NNFW_STATUS_INVALID_STATE.
NNFW_STATUS nnfw_session::train_input_tensorinfo | ( | uint32_t | index, |
nnfw_tensorinfo * | ti | ||
) |
NNFW_STATUS nnfw_session::train_prepare | ( | ) |
Definition at line 284 of file onert-micro.cpp.
References NNFW_STATUS_NO_ERROR.
NNFW_STATUS nnfw_session::train_prepare | ( | ) |
NNFW_STATUS nnfw_session::train_run | ( | bool | update_weights | ) |
Definition at line 291 of file onert-micro.cpp.
References onert_micro::OMTrainingInterpreter::allocateInputs(), onert_micro::OMTrainingContext::batch_size, onert_micro::OMTrainingInterpreter::getInputData(), onert_micro::OMTrainingInterpreter::getInputDataAt(), onert_micro::OMTrainingInterpreter::getInputSizeAt(), onert_micro::OMTrainingInterpreter::getOutputDataAt(), onert_micro::OMTrainingInterpreter::getOutputSizeAt(), NNFW_STATUS_NO_ERROR, onert_micro::OMTrainingContext::num_epoch, onert_micro::OMTrainingContext::num_step, onert_micro::OMTrainingInterpreter::reset(), onert_micro::OMTrainingInterpreter::run(), onert_micro::OMConfig::training_context, and onert_micro::OMTrainingInterpreter::trainSingleStep().
NNFW_STATUS nnfw_session::train_run | ( | bool | update_weights | ) |
NNFW_STATUS nnfw_session::train_set_expected | ( | uint32_t | index, |
const void * | expected, | ||
const nnfw_tensorinfo * | expected_tensorinfo | ||
) |
Definition at line 1470 of file nnfw_session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, NNFW_STATUS_UNEXPECTED_NULL, and size.
NNFW_STATUS nnfw_session::train_set_expected | ( | uint32_t | index, |
void * | expected | ||
) |
Definition at line 344 of file onert-micro.cpp.
References NNFW_STATUS_NO_ERROR, and onert_micro::OMTrainingInterpreter::setTarget().
NNFW_STATUS nnfw_session::train_set_input | ( | uint32_t | index, |
const void * | input, | ||
const nnfw_tensorinfo * | input_tensorinfo | ||
) |
Definition at line 1426 of file nnfw_session.cc.
References input_tensorinfo(), NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, NNFW_STATUS_UNEXPECTED_NULL, and size.
NNFW_STATUS nnfw_session::train_set_input | ( | uint32_t | index, |
void * | input | ||
) |
Definition at line 337 of file onert-micro.cpp.
References NNFW_STATUS_NO_ERROR, and onert_micro::OMTrainingInterpreter::setInput().
NNFW_STATUS nnfw_session::train_set_output | ( | uint32_t | index, |
NNFW_TYPE | type, | ||
void * | buffer, | ||
size_t | length | ||
) |
Definition at line 350 of file onert-micro.cpp.
References NNFW_STATUS_NO_ERROR.
NNFW_STATUS nnfw_session::train_set_output | ( | uint32_t | index, |
NNFW_TYPE | type, | ||
void * | buffer, | ||
size_t | length | ||
) |
NNFW_STATUS nnfw_session::train_set_traininfo | ( | const nnfw_train_info * | info | ) |
Definition at line 357 of file onert-micro.cpp.
References onert_micro::ADAM, onert_micro::OMTrainingContext::batch_size, onert_micro::OMTrainingContext::beta, onert_micro::OMTrainingContext::beta_squares, info, onert_micro::OMTrainingContext::learning_rate, NNFW_STATUS_NO_ERROR, NNFW_TRAIN_OPTIMIZER_ADAM, onert_micro::OMTrainingContext::num_of_train_layers, onert_micro::OMTrainingContext::optimizer, onert_micro::SGD, and onert_micro::OMConfig::training_context.
NNFW_STATUS nnfw_session::train_set_traininfo | ( | const nnfw_train_info * | info | ) |