[PyBind] Expose enable_mem_arena property for SessionOptions (#22323)

### Description
Expose enable_mem_arena property for SessionOptions

### Motivation and Context
https://github.com/microsoft/onnxruntime/issues/22271
This commit is contained in:
Dmitri Smirnov 2024-10-04 16:43:15 -07:00 committed by GitHub
parent 715b74d61a
commit 0645ad19a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1688,6 +1688,13 @@ Serialized model format will default to ONNX unless:
- there is no 'session.save_model_format' config entry and optimized_model_filepath ends in '.ort' (case insensitive)
)pbdoc")
.def_property(
"enable_cpu_mem_arena",
[](const PySessionOptions* options) -> bool { return options->value.enable_cpu_mem_arena; },
[](PySessionOptions* options, bool enable_cpu_mem_arena) -> void {
options->value.enable_cpu_mem_arena = enable_cpu_mem_arena;
},
R"pbdoc(Enable memory arena on CPU. Default is true.)pbdoc")
.def_property(
"enable_mem_pattern",
[](const PySessionOptions* options) -> bool { return options->value.enable_mem_pattern; },