Struct ort::EnvironmentBuilder
source · pub struct EnvironmentBuilder { /* private fields */ }
Expand description
Struct used to build an Environment
.
Implementations§
source§impl EnvironmentBuilder
impl EnvironmentBuilder
sourcepub fn with_name<S>(self, name: S) -> Self
pub fn with_name<S>(self, name: S) -> Self
Configure the environment with a given name for logging purposes.
sourcepub fn with_execution_providers(
self,
execution_providers: impl AsRef<[ExecutionProviderDispatch]>
) -> Self
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.
sourcepub fn with_global_thread_pool(
self,
options: EnvironmentGlobalThreadPoolOptions
) -> Self
pub fn with_global_thread_pool( self, options: EnvironmentGlobalThreadPoolOptions ) -> Self
Enables the global thread pool for this environment.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EnvironmentBuilder
impl RefUnwindSafe for EnvironmentBuilder
impl Send for EnvironmentBuilder
impl Sync for EnvironmentBuilder
impl Unpin for EnvironmentBuilder
impl UnwindSafe for EnvironmentBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more