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)
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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 more