Struct ort::EnvironmentBuilder

source ·
pub struct EnvironmentBuilder { /* private fields */ }
Expand description

Struct used to build an Environment.

Implementations§

source§

impl EnvironmentBuilder

source

pub fn with_name<S>(self, name: S) -> Self
where S: Into<String>,

Configure the environment with a given name for logging purposes.

source

pub fn with_execution_providers( self, execution_providers: impl AsRef<[ExecutionProviderDispatch]> ) -> Self

Sets a list of execution providers which all sessions created in this environment will register.

If a session is created in this environment with crate::SessionBuilder::with_execution_providers, those EPs will take precedence over the environment’s EPs.

Execution providers will only work if the corresponding Cargo feature is enabled and ONNX Runtime was built with support for the corresponding execution provider. Execution providers that do not have their corresponding feature enabled will emit a warning.

source

pub fn with_global_thread_pool( self, options: EnvironmentGlobalThreadPoolOptions ) -> Self

Enables the global thread pool for this environment.

source

pub fn commit(self) -> Result<()>

Commit the environment configuration and set the global environment.

Trait Implementations§

source§

impl Default for EnvironmentBuilder

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

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 T
where U: From<T>,

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, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
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