pub struct Engine {Show 13 fields
pub file: String,
pub spec: String,
pub device: Device,
pub iiixs: Vec<Iiix>,
pub params: Option<usize>,
pub wbmems: Option<usize>,
pub inputs_minoptmax: Vec<Vec<MinOptMax>>,
pub onnx: Option<OnnxIo>,
pub num_dry_run: usize,
pub graph_opt_level: Option<u8>,
pub num_intra_threads: Option<usize>,
pub num_inter_threads: Option<usize>,
pub hardware: HardwareConfig,
}Expand description
ONNX Runtime inference engine with configuration and session management.
Fields§
§file: StringModel file path.
spec: StringModel specification string.
device: DeviceExecution device.
iiixs: Vec<Iiix>§params: Option<usize>§wbmems: Option<usize>§inputs_minoptmax: Vec<Vec<MinOptMax>>Input min-opt-max configurations.
onnx: Option<OnnxIo>ONNX I/O structure.
num_dry_run: usizeNumber of dry runs for warmup.
graph_opt_level: Option<u8>§num_intra_threads: Option<usize>§num_inter_threads: Option<usize>§hardware: HardwareConfigHardware-specific configurations for all execution providers
Implementations§
Source§impl Engine
impl Engine
Sourcepub fn with_device(self, x: Device) -> Self
pub fn with_device(self, x: Device) -> Self
Sourcepub fn with_iiixs(self, x: &[Iiix]) -> Self
pub fn with_iiixs(self, x: &[Iiix]) -> Self
Sets the iiixs field from a slice.
§Arguments
x- A slice of elements to be converted into a vector
§Returns
Returns Self for method chaining.
§Note
If the slice is empty, the field remains unchanged.
§Example
let obj = Engine::default().with_iiixs(&[item1, item2]);Generated by aksr - Builder pattern macro
Sourcepub fn with_iiixs_extend(self, x: &[Iiix]) -> Self
pub fn with_iiixs_extend(self, x: &[Iiix]) -> Self
Sourcepub fn with_parameters(self, x: usize) -> Self
pub fn with_parameters(self, x: usize) -> Self
Sets the optional params field.
§Arguments
x- The value that will be automatically wrapped inSome
§Returns
Returns Self for method chaining.
§Note
The value is automatically wrapped in Some, so you don’t need to pass Some(value).
§Example
let obj = Engine::default().with_parameters(value);Generated by aksr - Builder pattern macro
Sourcepub fn parameters(&self) -> Option<usize>
pub fn parameters(&self) -> Option<usize>
Sourcepub fn with_memory(self, x: usize) -> Self
pub fn with_memory(self, x: usize) -> Self
Sets the optional wbmems field.
§Arguments
x- The value that will be automatically wrapped inSome
§Returns
Returns Self for method chaining.
§Note
The value is automatically wrapped in Some, so you don’t need to pass Some(value).
§Example
let obj = Engine::default().with_memory(value);Generated by aksr - Builder pattern macro
Sourcepub fn with_inputs_minoptmax(self, x: &[Vec<MinOptMax>]) -> Self
pub fn with_inputs_minoptmax(self, x: &[Vec<MinOptMax>]) -> Self
Sets the inputs_minoptmax field from a slice.
§Arguments
x- A slice of elements to be converted into a vector
§Returns
Returns Self for method chaining.
§Note
If the slice is empty, the field remains unchanged.
§Example
let obj = Engine::default().with_inputs_minoptmax(&[item1, item2]);Generated by aksr - Builder pattern macro
Sourcepub fn inputs_minoptmax(&self) -> &[Vec<MinOptMax>]
pub fn inputs_minoptmax(&self) -> &[Vec<MinOptMax>]
Sourcepub fn with_onnx(self, x: OnnxIo) -> Self
pub fn with_onnx(self, x: OnnxIo) -> Self
Sets the optional onnx field.
§Arguments
x- The value that will be automatically wrapped inSome
§Returns
Returns Self for method chaining.
§Note
The value is automatically wrapped in Some, so you don’t need to pass Some(value).
§Example
let obj = Engine::default().with_onnx(value);Generated by aksr - Builder pattern macro
Sourcepub fn with_num_dry_run(self, x: usize) -> Self
pub fn with_num_dry_run(self, x: usize) -> Self
Sourcepub fn num_dry_run(&self) -> usize
pub fn num_dry_run(&self) -> usize
Sourcepub fn with_graph_opt_level(self, x: u8) -> Self
pub fn with_graph_opt_level(self, x: u8) -> Self
Sets the optional graph_opt_level field.
§Arguments
x- The value that will be automatically wrapped inSome
§Returns
Returns Self for method chaining.
§Note
The value is automatically wrapped in Some, so you don’t need to pass Some(value).
§Example
let obj = Engine::default().with_graph_opt_level(value);Generated by aksr - Builder pattern macro
Sourcepub fn graph_opt_level(&self) -> Option<u8>
pub fn graph_opt_level(&self) -> Option<u8>
Sourcepub fn with_num_intra_threads(self, x: usize) -> Self
pub fn with_num_intra_threads(self, x: usize) -> Self
Sets the optional num_intra_threads field.
§Arguments
x- The value that will be automatically wrapped inSome
§Returns
Returns Self for method chaining.
§Note
The value is automatically wrapped in Some, so you don’t need to pass Some(value).
§Example
let obj = Engine::default().with_num_intra_threads(value);Generated by aksr - Builder pattern macro
Sourcepub fn num_intra_threads(&self) -> Option<usize>
pub fn num_intra_threads(&self) -> Option<usize>
Sourcepub fn with_num_inter_threads(self, x: usize) -> Self
pub fn with_num_inter_threads(self, x: usize) -> Self
Sets the optional num_inter_threads field.
§Arguments
x- The value that will be automatically wrapped inSome
§Returns
Returns Self for method chaining.
§Note
The value is automatically wrapped in Some, so you don’t need to pass Some(value).
§Example
let obj = Engine::default().with_num_inter_threads(value);Generated by aksr - Builder pattern macro
Sourcepub fn num_inter_threads(&self) -> Option<usize>
pub fn num_inter_threads(&self) -> Option<usize>
Sourcepub fn with_hardware(self, x: HardwareConfig) -> Self
pub fn with_hardware(self, x: HardwareConfig) -> Self
Sourcepub fn hardware(&self) -> &HardwareConfig
pub fn hardware(&self) -> &HardwareConfig
Source§impl Engine
impl Engine
pub fn try_from_config(config: &ORTConfig) -> Result<Self>
pub fn build(self) -> Result<Self>
pub fn dry_run(&mut self) -> Result<()>
pub fn run(&mut self, xs: Xs) -> Result<Xs>
pub fn load_onnx<P: AsRef<Path>>(p: P) -> Result<ModelProto>
pub fn batch(&self) -> &MinOptMax
pub fn is_batch_dyn(&self) -> bool
pub fn try_height(&self) -> Option<&MinOptMax>
pub fn height(&self) -> &MinOptMax
pub fn is_height_dyn(&self) -> bool
pub fn try_width(&self) -> Option<&MinOptMax>
pub fn width(&self) -> &MinOptMax
pub fn is_width_dyn(&self) -> bool
pub fn try_fetch(&self, key: &str) -> Option<String>
pub fn ir_version(&self) -> Option<usize>
pub fn opset_version(&self) -> Option<usize>
pub fn producer_name(&self) -> Option<String>
pub fn producer_version(&self) -> Option<String>
pub fn model_version(&self) -> Option<usize>
pub fn ishapes(&self) -> Option<&[Vec<usize>]>
pub fn idimss(&self) -> Option<&[Vec<usize>]>
pub fn inames(&self) -> Option<&[String]>
pub fn idtypes(&self) -> Option<Vec<DType>>
pub fn oshapes(&self) -> Option<&[Vec<usize>]>
pub fn odimss(&self) -> Option<&[Vec<usize>]>
pub fn onames(&self) -> Option<&[String]>
pub fn odtypes(&self) -> Option<Vec<DType>>
pub fn profile(&self)
pub fn info(&self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Engine
impl !RefUnwindSafe for Engine
impl Send for Engine
impl Sync for Engine
impl Unpin for Engine
impl !UnwindSafe for Engine
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.