|
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. | |
|
default |
| NNFW_STATUS onert::api::Session::await | ( | ) |
Definition at line 522 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 2235 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 1073 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 231 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 2398 of file Session.cc.
References NNFW_STATUS_ERROR, NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
| NNFW_STATUS onert::api::Session::deprecated | ( | const char * | msg | ) |
Definition at line 1145 of file Session.cc.
References NNFW_STATUS_DEPRECATED_API.
| NNFW_STATUS onert::api::Session::get_config | ( | const char * | key, |
| char * | value, | ||
| size_t | value_size | ||
| ) |
Definition at line 1281 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_last_error_message | ( | char * | buffer, |
| size_t | length | ||
| ) | const |
Definition at line 1131 of file Session.cc.
References NNFW_STATUS_INSUFFICIENT_OUTPUT_SIZE, 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 963 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 590 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 1447 of file Session.cc.
| NNFW_STATUS onert::api::Session::input_tensorinfo | ( | uint32_t | index, |
| nnfw_tensorinfo * | ti | ||
| ) |
Definition at line 869 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 260 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 296 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 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::output_tensorindex | ( | const char * | tensorname, |
| uint32_t * | index | ||
| ) |
Definition at line 1452 of file Session.cc.
| NNFW_STATUS onert::api::Session::output_tensorinfo | ( | uint32_t | index, |
| nnfw_tensorinfo * | ti | ||
| ) |
Definition at line 912 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 446 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 2185 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 957 of file Session.cc.
References NNFW_STATUS_NO_ERROR.
| NNFW_STATUS onert::api::Session::reset_execute_config | ( | ) |
Definition at line 2367 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 2323 of file Session.cc.
References NNFW_STATUS_INVALID_STATE, and NNFW_STATUS_NO_ERROR.
| NNFW_STATUS onert::api::Session::run | ( | ) |
Definition at line 479 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 507 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 2414 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 1018 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 1457 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 2213 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 1151 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 2336 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 537 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 642 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 817 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 729 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 2382 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 563 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 685 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 773 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 2299 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 2121 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 2163 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 1102 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 1052 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 1774 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 2064 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 1979 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 2008 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 1945 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 1497 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 2037 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 1757 of file Session.cc.
References NNFW_STATUS_ERROR, and NNFW_STATUS_INVALID_STATE.
| NNFW_STATUS onert::api::Session::train_prepare | ( | ) |
Definition at line 1719 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 1911 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 1834 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 1791 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 1883 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 1615 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.