Struct ort::environment::Environment
source · pub struct Environment { /* private fields */ }
Expand description
An Environment
is the main entry point of the ONNX Runtime.
Only one ONNX environment can be created per process. A singleton (through lazy_static!()
) is used to enforce
this.
Once an environment is created, a super::Session
can be obtained from it.
NOTE: While the Environment
constructor takes a name
parameter to name the environment, only the first
name will be considered if many environments are created.
Example
let environment = Environment::builder().with_name("test").with_log_level(LoggingLevel::Verbose).build()?;
Implementations§
source§impl Environment
impl Environment
sourcepub fn builder() -> EnvBuilder
pub fn builder() -> EnvBuilder
Create a new environment builder using default values
(name: default
, log level: LoggingLevel::Warning
)
sourcepub fn into_arc(self) -> Arc<Environment>
pub fn into_arc(self) -> Arc<Environment>
Wraps this environment in an Arc
for use with SessionBuilder
.
pub fn ptr(&self) -> *const OrtEnv
Trait Implementations§
source§impl Clone for Environment
impl Clone for Environment
source§fn clone(&self) -> Environment
fn clone(&self) -> Environment
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Environment
impl Debug for Environment
source§impl Default for Environment
impl Default for Environment
source§impl Drop for Environment
impl Drop for Environment
impl Send for Environment
impl Sync for Environment
Auto Trait Implementations§
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