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

source

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.

source

pub fn cpu() -> Self

Creates a new CPUExecutionProvider configuration object.

source

pub fn cuda() -> Self

Creates a new CUDAExecutionProvider configuration object.

source

pub fn tensorrt() -> Self

Creates a new TensorrtExecutionProvider configuration object.

source

pub fn acl() -> Self

Creates a new AclExecutionProvider configuration object.

source

pub fn dnnl() -> Self

Creates a new DnnlExecutionProvider configuration object.

source

pub fn onednn() -> Self

Creates a new DnnlExecutionProvider configuration object.

source

pub fn coreml() -> Self

Creates a new CoreMLExecutionProvider configuration object.

source

pub fn directml() -> Self

Creates a new DmlExecutionProvider configuration object.

source

pub fn rocm() -> Self

Creates a new ROCmExecutionProvider configuration object.

source

pub fn is_available(&self) -> bool

Returns true if this execution provider is available, false otherwise. The CPU execution provider will always be available.

source

pub fn with(self, name: impl Into<String>, value: impl Into<String>) -> Self

Configure this execution provider with the given option name and value

source

pub fn with_use_arena(self, v: bool) -> Self

Whether or not to use the arena allocator.

Supported backends: CPU, ACL, oneDNN

source

pub fn with_device_id(self, v: i32) -> Self

The device ID to initialize the execution provider on.

Supported backends: DirectML

source

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

source§

fn clone(&self) -> ExecutionProvider

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ExecutionProvider

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more