mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-12 17:57:38 +00:00
Update pythin bindings for options (#14)
This commit is contained in:
parent
728c3c078e
commit
1ea32a097a
1 changed files with 21 additions and 5 deletions
|
|
@ -231,21 +231,37 @@ void addObjectMethods(py::module& m) {
|
|||
py::add_ostream_redirect(m, "onnxruntime_ostream_redirect");
|
||||
py::class_<SessionOptions>(m, "SessionOptions", R"pbdoc(Configuration information for a session.)pbdoc")
|
||||
.def(py::init())
|
||||
.def_readwrite("enable_mem_pattern", &SessionOptions::enable_mem_pattern,
|
||||
R"pbdoc(Enables the memory pattern optimization.
|
||||
The idea is if the input shapes are the same, we could trace the internal memory allocation
|
||||
and generate a memory pattern for future request. So next time we could just do one allocation
|
||||
with a big chunk for all the internal memory allocation. Default is true.)pbdoc")
|
||||
.def_readwrite("enable_cpu_mem_arena", &SessionOptions::enable_cpu_mem_arena,
|
||||
R"pbdoc(Enables the memory arena on CPU. Arena may pre-allocate memory for future usage.
|
||||
Set this option to false if you don't want it. Default is True.)pbdoc")
|
||||
.def_readwrite("enable_profiling", &SessionOptions::enable_profiling,
|
||||
R"pbdoc(Enable profiling for this session.)pbdoc")
|
||||
.def_readwrite("profile_file_prefix", &SessionOptions::profile_file_prefix,
|
||||
R"pbdoc(The prefix of the profile file. The current time will be appended to the file name.)pbdoc")
|
||||
R"pbdoc(Enable profiling for this session. Default is false.)pbdoc")
|
||||
.def_readwrite("enable_sequential_execution", &SessionOptions::enable_sequential_execution,
|
||||
R"pbdoc(Enables sequential execution, disables parallel execution. Default is true.)pbdoc")
|
||||
.def_readwrite("max_num_graph_transformation_steps", &SessionOptions::max_num_graph_transformation_steps,
|
||||
R"pbdoc(Runs optimization steps on the execution graph. Default is 5.)pbdoc")
|
||||
.def_readwrite("session_logid", &SessionOptions::session_logid,
|
||||
R"pbdoc(Logger id to use for session output.)pbdoc")
|
||||
.def_readwrite("session_log_verbosity_level", &SessionOptions::session_log_verbosity_level,
|
||||
R"pbdoc(Applies to session load, initialization, etc.)pbdoc");
|
||||
R"pbdoc(Applies to session load, initialization, etc. Default is 0.)pbdoc")
|
||||
.def_readwrite("session_thread_pool_size", &SessionOptions::session_thread_pool_size,
|
||||
R"pbdoc(How many threads in the session thread pool. Default is 0 to let onnxruntime choose.
|
||||
This parameter is unused unless *enable_sequential_execution* is false.)pbdoc");
|
||||
|
||||
py::class_<RunOptions>(m, "RunOptions", R"pbdoc(Configuration information for a single Run.)pbdoc")
|
||||
.def(py::init())
|
||||
.def_readwrite("run_log_verbosity_level", &RunOptions::run_log_verbosity_level,
|
||||
"Applies to a particular Run() invocation.")
|
||||
.def_readwrite("run_tag", &RunOptions::run_tag,
|
||||
"To identify logs generated by a particular Run() invocation.");
|
||||
"To identify logs generated by a particular Run() invocation.")
|
||||
.def_readwrite("terminate", &RunOptions::terminate,
|
||||
R"pbdoc(Set to True to terminate any currently executing calls that are using this
|
||||
RunOptions instance. The individual calls will exit gracefully and return an error status.)pbdoc");
|
||||
|
||||
py::class_<ModelMetadata>(m, "ModelMetadata", R"pbdoc(Pre-defined and custom metadata about the model.
|
||||
It is usually used to identify the model used to run the prediction and
|
||||
|
|
|
|||
Loading…
Reference in a new issue