pub struct InferenceEngine { /* private fields */ }Expand description
Inference engine
Implementations§
Source§impl InferenceEngine
impl InferenceEngine
pub fn new() -> Self
pub fn initialize(&mut self) -> Result<(), MLError>
Sourcepub fn register_backend(&mut self, backend: InferenceBackend)
pub fn register_backend(&mut self, backend: InferenceBackend)
Register an inference backend under its backend id.
Sourcepub fn get_backend(&self, backend_id: &str) -> Option<&InferenceBackend>
pub fn get_backend(&self, backend_id: &str) -> Option<&InferenceBackend>
Get a registered inference backend by id.
Sourcepub fn list_backends(&self) -> Vec<String>
pub fn list_backends(&self) -> Vec<String>
List the ids of all registered inference backends.
Sourcepub fn remove_backend(&mut self, backend_id: &str) -> bool
pub fn remove_backend(&mut self, backend_id: &str) -> bool
Remove a registered inference backend by id. Returns true if removed.
pub fn execute_inference( &mut self, request: &InferenceRequest, model: &Model, ) -> Result<InferenceResult, MLError>
Auto Trait Implementations§
impl Freeze for InferenceEngine
impl RefUnwindSafe for InferenceEngine
impl Send for InferenceEngine
impl Sync for InferenceEngine
impl Unpin for InferenceEngine
impl UnsafeUnpin for InferenceEngine
impl UnwindSafe for InferenceEngine
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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