|
ONE - On-device Neural Engine
|
#include <Session.h>
Static Public Member Functions | |
| static NNFW_STATUS | create (Session **session) |
| Factory method. It creates and initialize Session. | |
| static NNFW_STATUS | deprecated (const char *msg) |
|
default |
| NNFW_STATUS onert::api::Session::await | ( | ) |
Definition at line 547 of file Session.cc.
References NNFW_STATUS_ERROR, and NNFW_STATUS_NO_ERROR.
| NNFW_STATUS onert::api::Session::codegen | ( | const char * | target, |
| NNFW_CODEGEN_PREF | pref | ||
| ) |
Definition at line 2122 of file 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.
| NNFW_STATUS onert::api::Session::configure_signature | ( | const char * | signature | ) |
Definition at line 1074 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and NNFW_STATUS_UNEXPECTED_NULL.
|
static |
Factory method. It creates and initialize Session.
Definition at line 267 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_NO_ERROR, NNFW_STATUS_OUT_OF_MEMORY, and NNFW_STATUS_UNEXPECTED_NULL.
Referenced by nnfw_create_session().
| NNFW_STATUS onert::api::Session::delete_odc_minmax_file | ( | ) |
Definition at line 2281 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
|
static |
Definition at line 1125 of file 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 onert::api::Session::get_config | ( | const char * | key, |
| char * | value, | ||
| size_t | value_size | ||
| ) |
Definition at line 1235 of file Session.cc.
References nnfw::misc::join(), NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and NNFW_STATUS_UNEXPECTED_NULL.
| NNFW_STATUS onert::api::Session::get_output | ( | uint32_t | index, |
| nnfw_tensorinfo * | out_info, | ||
| const void ** | out_buffer | ||
| ) |
Definition at line 979 of file Session.cc.
References info, NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and NNFW_STATUS_UNEXPECTED_NULL.
| NNFW_STATUS onert::api::Session::input_size | ( | uint32_t * | number | ) |
Definition at line 616 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and NNFW_STATUS_UNEXPECTED_NULL.
| NNFW_STATUS onert::api::Session::input_tensorindex | ( | const char * | tensorname, |
| uint32_t * | index | ||
| ) |
Definition at line 1351 of file Session.cc.
| NNFW_STATUS onert::api::Session::input_tensorinfo | ( | uint32_t | index, |
| nnfw_tensorinfo * | ti | ||
| ) |
Definition at line 889 of file Session.cc.
References info, NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and NNFW_STATUS_UNEXPECTED_NULL.
| NNFW_STATUS onert::api::Session::load_circle_from_buffer | ( | uint8_t * | buffer, |
| size_t | size | ||
| ) |
Definition at line 294 of file 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 onert::api::Session::load_model_from_path | ( | const char * | path | ) |
Definition at line 321 of file 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 onert::api::Session::output_size | ( | uint32_t * | number | ) |
Definition at line 638 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and NNFW_STATUS_UNEXPECTED_NULL.
| NNFW_STATUS onert::api::Session::output_tensorindex | ( | const char * | tensorname, |
| uint32_t * | index | ||
| ) |
Definition at line 1356 of file Session.cc.
| NNFW_STATUS onert::api::Session::output_tensorinfo | ( | uint32_t | index, |
| nnfw_tensorinfo * | ti | ||
| ) |
Definition at line 930 of file Session.cc.
References info, NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and NNFW_STATUS_UNEXPECTED_NULL.
| NNFW_STATUS onert::api::Session::prepare | ( | ) |
Definition at line 468 of file Session.cc.
References onert::compiler::CompilerFactory::create(), onert::compiler::CompilerFactory::get(), NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
| NNFW_STATUS onert::api::Session::quantize | ( | ) |
Definition at line 2075 of file Session.cc.
References NNFW_STATUS_ERROR, and NNFW_STATUS_INVALID_STATE.
| NNFW_STATUS onert::api::Session::register_custom_operation | ( | const std::string & | id, |
| nnfw_custom_eval | eval_func | ||
| ) |
Definition at line 973 of file Session.cc.
References NNFW_STATUS_NO_ERROR.
| NNFW_STATUS onert::api::Session::reset_execute_config | ( | ) |
Definition at line 2252 of file Session.cc.
References NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
| NNFW_STATUS onert::api::Session::reset_prepare_config | ( | ) |
Definition at line 2209 of file Session.cc.
References NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
| NNFW_STATUS onert::api::Session::run | ( | ) |
Definition at line 503 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INSUFFICIENT_OUTPUT_SIZE, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and onert::Exception::what().
| NNFW_STATUS onert::api::Session::run_async | ( | ) |
Definition at line 532 of file Session.cc.
References NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
| NNFW_STATUS onert::api::Session::run_with_auto_compilation | ( | const char * | target, |
| NNFW_CODEGEN_PREF | pref | ||
| ) |
Definition at line 2296 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INSUFFICIENT_OUTPUT_SIZE, NNFW_STATUS_INVALID_STATE, and onert::Exception::what().
| NNFW_STATUS onert::api::Session::set_available_backends | ( | const char * | backends | ) |
Definition at line 1035 of file 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 onert::api::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 1361 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
| NNFW_STATUS onert::api::Session::set_codegen_model_path | ( | const char * | path | ) |
Definition at line 2100 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
| NNFW_STATUS onert::api::Session::set_config | ( | const char * | key, |
| const char * | value | ||
| ) |
Definition at line 1131 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, NNFW_STATUS_UNEXPECTED_NULL, onert::util::setConfigKeyValues(), and UPDATE_VERBOSE_CONFIG.
| NNFW_STATUS onert::api::Session::set_execute_config | ( | const NNFW_RUN_CONFIG | key, |
| const char * | value | ||
| ) |
Definition at line 2222 of file 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 onert::api::Session::set_input | ( | uint32_t | index, |
| NNFW_TYPE | type, | ||
| const void * | buffer, | ||
| size_t | length | ||
| ) |
Definition at line 562 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
| NNFW_STATUS onert::api::Session::set_input_layout | ( | uint32_t | index, |
| NNFW_LAYOUT | layout | ||
| ) |
Definition at line 660 of file 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 onert::api::Session::set_input_tensorinfo | ( | uint32_t | index, |
| const nnfw_tensorinfo * | ti | ||
| ) |
Definition at line 839 of file 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 onert::api::Session::set_input_type | ( | uint32_t | index, |
| NNFW_TYPE | type | ||
| ) |
Definition at line 749 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, NNFW_TYPE_TENSOR_FLOAT32, and type.
| NNFW_STATUS onert::api::Session::set_odc_param_minmax_records_count | ( | int | minmax_records_count | ) |
Definition at line 2267 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
| NNFW_STATUS onert::api::Session::set_output | ( | uint32_t | index, |
| NNFW_TYPE | type, | ||
| void * | buffer, | ||
| size_t | length | ||
| ) |
Definition at line 589 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
| NNFW_STATUS onert::api::Session::set_output_layout | ( | uint32_t | index, |
| NNFW_LAYOUT | layout | ||
| ) |
Definition at line 704 of file 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 onert::api::Session::set_output_type | ( | uint32_t | index, |
| NNFW_TYPE | type | ||
| ) |
Definition at line 794 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, NNFW_TYPE_TENSOR_FLOAT32, and type.
| NNFW_STATUS onert::api::Session::set_prepare_config | ( | const NNFW_PREPARE_CONFIG | key, |
| const char * | value | ||
| ) |
Definition at line 2186 of file Session.cc.
References NNFW_ENABLE_INTERNAL_OUTPUT_ALLOC, NNFW_PREPARE_CONFIG_PROFILE, NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
| NNFW_STATUS onert::api::Session::set_quantization_type | ( | NNFW_QUANTIZE_TYPE | qtype | ) |
Definition at line 2014 of file 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 onert::api::Session::set_quantized_model_path | ( | const char * | path | ) |
Definition at line 2054 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
| NNFW_STATUS onert::api::Session::set_signature_run | ( | const char * | signature | ) |
Definition at line 1100 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and NNFW_STATUS_UNEXPECTED_NULL.
| NNFW_STATUS onert::api::Session::set_workspace | ( | const char * | dir | ) |
Definition at line 1059 of file Session.cc.
References NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and NNFW_STATUS_UNEXPECTED_NULL.
| NNFW_STATUS onert::api::Session::train_expected_tensorinfo | ( | uint32_t | index, |
| nnfw_tensorinfo * | ti | ||
| ) |
Definition at line 1668 of file Session.cc.
References NNFW_STATUS_ERROR, and NNFW_STATUS_INVALID_STATE.
| NNFW_STATUS onert::api::Session::train_export_checkpoint | ( | const char * | path | ) |
Definition at line 1957 of file Session.cc.
References onert::exporter::train::exportCheckpoint(), NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and NNFW_STATUS_UNEXPECTED_NULL.
| NNFW_STATUS onert::api::Session::train_export_circle | ( | const char * | path | ) |
Definition at line 1872 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, NNFW_STATUS_UNEXPECTED_NULL, and onert::exporter::CircleExporter::updateWeight().
| NNFW_STATUS onert::api::Session::train_export_circleplus | ( | const char * | path | ) |
Definition at line 1901 of file 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 onert::api::Session::train_get_loss | ( | uint32_t | index, |
| float * | loss | ||
| ) |
Definition at line 1838 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and NNFW_STATUS_UNEXPECTED_NULL.
| NNFW_STATUS onert::api::Session::train_get_traininfo | ( | nnfw_train_info * | info | ) |
Definition at line 1392 of file 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::train::SGD, onert::ir::train::Sum, onert::ir::train::SumOverBatchSize, type, and onert::ir::train::Undefined.
| NNFW_STATUS onert::api::Session::train_import_checkpoint | ( | const char * | path | ) |
Definition at line 1930 of file Session.cc.
References onert::loader::train::loadCheckpoint(), NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and NNFW_STATUS_UNEXPECTED_NULL.
| NNFW_STATUS onert::api::Session::train_input_tensorinfo | ( | uint32_t | index, |
| nnfw_tensorinfo * | ti | ||
| ) |
Definition at line 1652 of file Session.cc.
References NNFW_STATUS_ERROR, and NNFW_STATUS_INVALID_STATE.
| NNFW_STATUS onert::api::Session::train_prepare | ( | ) |
Definition at line 1612 of file Session.cc.
References onert::compiler::CompilerFactory::create(), onert::compiler::CompilerFactory::get(), NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
| NNFW_STATUS onert::api::Session::train_run | ( | bool | update_weights | ) |
Definition at line 1804 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INSUFFICIENT_OUTPUT_SIZE, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, and onert::Exception::what().
| NNFW_STATUS onert::api::Session::train_set_expected | ( | uint32_t | index, |
| const void * | expected, | ||
| const nnfw_tensorinfo * | expected_tensorinfo | ||
| ) |
Definition at line 1727 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, NNFW_STATUS_UNEXPECTED_NULL, and size.
| NNFW_STATUS onert::api::Session::train_set_input | ( | uint32_t | index, |
| const void * | input, | ||
| const nnfw_tensorinfo * | input_tensorinfo | ||
| ) |
Definition at line 1684 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, NNFW_STATUS_NO_ERROR, NNFW_STATUS_UNEXPECTED_NULL, and size.
| NNFW_STATUS onert::api::Session::train_set_output | ( | uint32_t | index, |
| NNFW_TYPE | type, | ||
| void * | buffer, | ||
| size_t | length | ||
| ) |
Definition at line 1775 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
| NNFW_STATUS onert::api::Session::train_set_traininfo | ( | const nnfw_train_info * | info | ) |
Definition at line 1510 of file Session.cc.
References onert::ir::train::Adam, onert::ir::train::CategoricalCrossentropy, info, onert::ir::train::OptimizerInfo::learning_rate, onert::ir::train::LossInfo::loss_code, 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_OPTIMIZER_ADAM, NNFW_TRAIN_OPTIMIZER_SGD, NNFW_TRAIN_TRAINABLE_ALL, onert::ir::train::OptimizerInfo::optim_code, onert::ir::train::LossInfo::reduction_type, onert::ir::train::SGD, onert::ir::train::Sum, onert::ir::train::SumOverBatchSize, and type.