pub struct DeviceModel<'a, M> { /* private fields */ }Expand description
Binds an accelerated model to a device while retaining the ordinary
Predict interface consumed by every explainer.
Implementations§
Source§impl<'a, M> DeviceModel<'a, M>
impl<'a, M> DeviceModel<'a, M>
pub fn new(model: &'a M, device: ExecutionDevice) -> Self
pub fn device(&self) -> ExecutionDevice
Trait Implementations§
Source§impl<M: AcceleratedPredict> Predict for DeviceModel<'_, M>
impl<M: AcceleratedPredict> Predict for DeviceModel<'_, M>
Source§fn predict(&self, x: ArrayView2<'_, f64>) -> Result<Array2<f64>>
fn predict(&self, x: ArrayView2<'_, f64>) -> Result<Array2<f64>>
Predict outputs for a batch of samples. Read more
Source§fn predict_owned(&self, x: Array2<f64>) -> Result<Array2<f64>>
fn predict_owned(&self, x: Array2<f64>) -> Result<Array2<f64>>
Predicts from an owned batch. Read more
Auto Trait Implementations§
impl<'a, M> Freeze for DeviceModel<'a, M>
impl<'a, M> RefUnwindSafe for DeviceModel<'a, M>where
M: RefUnwindSafe,
impl<'a, M> Send for DeviceModel<'a, M>where
M: Sync,
impl<'a, M> Sync for DeviceModel<'a, M>where
M: Sync,
impl<'a, M> Unpin for DeviceModel<'a, M>
impl<'a, M> UnsafeUnpin for DeviceModel<'a, M>
impl<'a, M> UnwindSafe for DeviceModel<'a, M>where
M: RefUnwindSafe,
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