pub struct InferenceRuntime { /* private fields */ }Expand description
Main inference runtime that manages different backends
Implementations§
Source§impl InferenceRuntime
impl InferenceRuntime
Sourcepub async fn from_model_with_device(
model: Box<dyn Model>,
device: Device,
) -> EdgeResult<Self>
pub async fn from_model_with_device( model: Box<dyn Model>, device: Device, ) -> EdgeResult<Self>
Create a new inference runtime from a model with a specific device
Sourcepub async fn from_model(model: Box<dyn Model>) -> EdgeResult<Self>
pub async fn from_model(model: Box<dyn Model>) -> EdgeResult<Self>
Create a new inference runtime from a model (uses CPU device by default, WebGPU on WASM)
Sourcepub fn infer(&mut self, input: InferenceInput) -> EdgeResult<InferenceOutput>
pub fn infer(&mut self, input: InferenceInput) -> EdgeResult<InferenceOutput>
Run inference on the loaded model
Sourcepub fn model_info(&self) -> HashMap<String, Value>
pub fn model_info(&self) -> HashMap<String, Value>
Get comprehensive model information
Sourcepub fn backend_info(&self) -> HashMap<String, Value>
pub fn backend_info(&self) -> HashMap<String, Value>
Get backend information
Auto Trait Implementations§
impl Freeze for InferenceRuntime
impl !RefUnwindSafe for InferenceRuntime
impl Send for InferenceRuntime
impl Sync for InferenceRuntime
impl Unpin for InferenceRuntime
impl !UnwindSafe for InferenceRuntime
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