ModuleAdapter

Trait ModuleAdapter 

Source
pub trait ModuleAdapter: Send + Sync {
    // Required methods
    fn adapt(&self, snapshot: &TensorSnapshot) -> TensorSnapshot;
    fn clone_box(&self) -> Box<dyn ModuleAdapter>;
}
Expand description

Trait for adapting tensor snapshots between different module formats

Required Methods§

Source

fn adapt(&self, snapshot: &TensorSnapshot) -> TensorSnapshot

Adapt a tensor snapshot based on its container type and parameter name

Source

fn clone_box(&self) -> Box<dyn ModuleAdapter>

Clone the adapter into a boxed trait object

Trait Implementations§

Source§

impl Clone for Box<dyn ModuleAdapter>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§