Trait ModuleIO

Source
pub trait ModuleIO {
    // Required methods
    fn save(self, path: impl AsRef<Path>) -> Result<(), ZyxError>;
    fn load(self, path: impl AsRef<Path>) -> Result<(), ZyxError>;
}
Expand description

This trait is implemented automatically for all modules that implement IntoIterator<Item = &mut Tensor>

Required Methods§

Source

fn save(self, path: impl AsRef<Path>) -> Result<(), ZyxError>

Save self into path

Source

fn load(self, path: impl AsRef<Path>) -> Result<(), ZyxError>

Load self from path

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a, B: Backend + 'a, Tensors: IntoIterator<Item = &'a mut Tensor<B>>> ModuleIO for Tensors