Struct ort::execution_providers::ExecutionProvider
source · pub struct ExecutionProvider { /* private fields */ }
Expand description
Execution provider container. See the ONNX Runtime docs for more
info on execution providers. Execution providers are actually registered via the with_execution_providers()
functions crate::SessionBuilder
(per-session) or EnvBuilder
(default for all
sessions in an environment).
Implementations§
source§impl ExecutionProvider
impl ExecutionProvider
sourcepub fn new(provider: impl Into<String>) -> Self
pub fn new(provider: impl Into<String>) -> Self
Creates an ExecutionProvider
for the given execution provider name.
You probably want the dedicated methods instead, e.g. ExecutionProvider::cuda
.
sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
Returns true
if this execution provider is available, false
otherwise.
The CPU execution provider will always be available.
sourcepub fn with(self, name: impl Into<String>, value: impl Into<String>) -> Self
pub fn with(self, name: impl Into<String>, value: impl Into<String>) -> Self
Configure this execution provider with the given option name and value
sourcepub fn with_use_arena(self, v: bool) -> Self
pub fn with_use_arena(self, v: bool) -> Self
Whether or not to use the arena allocator.
Supported backends: CPU, ACL, oneDNN
sourcepub fn with_device_id(self, v: i32) -> Self
pub fn with_device_id(self, v: i32) -> Self
The device ID to initialize the execution provider on.
Supported backends: DirectML
sourcepub fn with_ane_only(self, v: bool) -> Self
pub fn with_ane_only(self, v: bool) -> Self
By default, the CoreML EP will be enabled for all compatible Apple devices. Setting this option will only enable CoreML EP for Apple devices with a compatible Apple Neural Engine (ANE).
Note: Enabling this option does not guarantee the entire model to be executed using ANE only.
Supported backends: CoreML
Trait Implementations§
source§impl Clone for ExecutionProvider
impl Clone for ExecutionProvider
source§fn clone(&self) -> ExecutionProvider
fn clone(&self) -> ExecutionProvider
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more