pub struct Session<B: Backend> { /* private fields */ }Implementations§
Source§impl<B: Backend<FloatElem = f32>> Session<B>
impl<B: Backend<FloatElem = f32>> Session<B>
pub fn new(device: &B::Device) -> Result<Self, Error>
pub fn from_file( device: &B::Device, path: impl AsRef<Path>, ) -> Result<Self, Error>
pub fn from_bytes(device: &B::Device, bytes: &[u8]) -> Result<Self, Error>
pub fn identify_file_sync( &mut self, path: impl AsRef<Path>, ) -> Result<FileType, Error>
pub async fn identify_file_async( &mut self, path: impl AsRef<Path>, ) -> Result<FileType, Error>
pub fn identify_content_sync(&mut self, bytes: &[u8]) -> Result<FileType, Error>
pub async fn identify_content_async( &mut self, bytes: &[u8], ) -> Result<FileType, Error>
Auto Trait Implementations§
impl<B> Freeze for Session<B>where
<B as BackendTypes>::Device: Freeze,
<B as BackendTypes>::FloatTensorPrimitive: Freeze,
<B as BackendTypes>::QuantizedTensorPrimitive: Freeze,
impl<B> RefUnwindSafe for Session<B>where
<B as BackendTypes>::Device: RefUnwindSafe,
<B as BackendTypes>::FloatTensorPrimitive: RefUnwindSafe,
<B as BackendTypes>::QuantizedTensorPrimitive: RefUnwindSafe,
impl<B> Send for Session<B>
impl<B> Sync for Session<B>
impl<B> Unpin for Session<B>where
<B as BackendTypes>::Device: Unpin,
<B as BackendTypes>::FloatTensorPrimitive: Unpin,
<B as BackendTypes>::QuantizedTensorPrimitive: Unpin,
impl<B> UnsafeUnpin for Session<B>where
<B as BackendTypes>::Device: UnsafeUnpin,
<B as BackendTypes>::FloatTensorPrimitive: UnsafeUnpin,
<B as BackendTypes>::QuantizedTensorPrimitive: UnsafeUnpin,
impl<B> UnwindSafe for Session<B>where
<B as BackendTypes>::Device: UnwindSafe,
<B as BackendTypes>::FloatTensorPrimitive: UnwindSafe,
<B as BackendTypes>::QuantizedTensorPrimitive: UnwindSafe,
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