pub struct InferencePipeline { /* private fields */ }Expand description
Builder-style inference pipeline that wraps a SequentialModel with
optional pre- and post-processing closures.
Implementations§
Source§impl InferencePipeline
impl InferencePipeline
Sourcepub fn new(model: SequentialModel) -> Self
pub fn new(model: SequentialModel) -> Self
Create a new pipeline wrapping the given model with no pre/post processing.
Sourcepub fn with_preprocess<F>(self, f: F) -> Self
pub fn with_preprocess<F>(self, f: F) -> Self
Attach a preprocessing closure that transforms the input tensor before it is fed to the model.
Sourcepub fn with_postprocess<F>(self, f: F) -> Self
pub fn with_postprocess<F>(self, f: F) -> Self
Attach a postprocessing closure that transforms the model output tensor before it is returned to the caller.
Auto Trait Implementations§
impl Freeze for InferencePipeline
impl !RefUnwindSafe for InferencePipeline
impl !Send for InferencePipeline
impl !Sync for InferencePipeline
impl Unpin for InferencePipeline
impl UnsafeUnpin for InferencePipeline
impl !UnwindSafe for InferencePipeline
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> 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