Struct tch::jit::TrainableCModule [−][src]
The trainable version of a jit PyTorch module.
These modules can be created via the TorchScript python api.
Implementations
impl TrainableCModule
[src]
pub fn load<T: AsRef<Path>>(
module_path: T,
path: Path<'_>
) -> Result<Self, TchError>
[src]
module_path: T,
path: Path<'_>
) -> Result<Self, TchError>
Loads a PyTorch saved JIT module from a file.
This function also adds the tensors from the JIT module to the VarStore path passed as argument so that the module can be trained.
pub fn load_data<T: Read>(
data: &mut T,
path: Path<'_>
) -> Result<Self, TchError>
[src]
data: &mut T,
path: Path<'_>
) -> Result<Self, TchError>
Loads a PyTorch saved JIT model from a read instance.
This function also adds the tensors from the JIT module to the VarStore path passed as argument so that the module can be trained.
pub fn save<T: AsRef<Path>>(&self, module_path: T) -> Result<(), TchError>
[src]
pub fn f_set_train(&mut self) -> Result<(), TchError>
[src]
Switches the module to training mode.
pub fn set_train(&mut self)
[src]
Switches the module to training mode.
pub fn f_set_eval(&mut self) -> Result<(), TchError>
[src]
Switches the module to evaluation mode.
pub fn set_eval(&mut self)
[src]
Switches the module to evaluation mode.
Trait Implementations
impl Debug for TrainableCModule
[src]
impl ModuleT for TrainableCModule
[src]
Auto Trait Implementations
impl RefUnwindSafe for TrainableCModule
impl Send for TrainableCModule
impl Sync for TrainableCModule
impl Unpin for TrainableCModule
impl UnwindSafe for TrainableCModule
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,