pub struct SessionOptions {
pub provider: ExecutionProvider,
pub device_id: Option<i32>,
pub threads: Option<usize>,
pub directml_static_shape_workaround: bool,
}Fields§
§provider: ExecutionProvider§device_id: Option<i32>DirectML adapter index; None lets the runtime pick.
threads: Option<usize>Explicit intra-op threads. Opts the session out of the shared pool.
directml_static_shape_workaround: boolSet for graphs with a fixed time dimension run on DirectML: applies the HeardRight-measured fusion workaround (ORT-DirectML 1.24.4 silently returns near-zero output for static-shape conformer encoders). Remove once a fixed onnxruntime-directml release passes the corpus.
Implementations§
Source§impl SessionOptions
impl SessionOptions
pub fn new(provider: ExecutionProvider) -> Self
pub fn with_device_id(self, device_id: Option<i32>) -> Self
pub fn with_threads(self, threads: Option<usize>) -> Self
Sourcepub fn cpu_for_stage(&self) -> Self
pub fn cpu_for_stage(&self) -> Self
Same options forced to CPU, for dispatch-bound stages (mel, decoder/joint).
pub fn build_from_file(&self, path: &Path) -> Result<Session, SessionError>
pub fn build_from_memory(&self, bytes: &[u8]) -> Result<Session, SessionError>
Trait Implementations§
Source§impl Clone for SessionOptions
impl Clone for SessionOptions
Source§impl Debug for SessionOptions
impl Debug for SessionOptions
Auto Trait Implementations§
impl Freeze for SessionOptions
impl RefUnwindSafe for SessionOptions
impl Send for SessionOptions
impl Sync for SessionOptions
impl Unpin for SessionOptions
impl UnsafeUnpin for SessionOptions
impl UnwindSafe for SessionOptions
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