pub struct PyTorchToBurnAdapter;Expand description
Adapter for converting from PyTorch format to Burn format
Handles:
- Linear layer weight transposition (PyTorch: [out, in] -> Burn: [in, out])
- Normalization parameter renaming (weight -> gamma, bias -> beta)
Trait Implementations§
Source§impl Clone for PyTorchToBurnAdapter
impl Clone for PyTorchToBurnAdapter
Source§impl Debug for PyTorchToBurnAdapter
impl Debug for PyTorchToBurnAdapter
Source§impl Default for PyTorchToBurnAdapter
impl Default for PyTorchToBurnAdapter
Source§impl ModuleAdapter for PyTorchToBurnAdapter
impl ModuleAdapter for PyTorchToBurnAdapter
Source§fn adapt(&self, tensor: PackTensor, ctx: ModuleContext<'_>) -> PackTensor
fn adapt(&self, tensor: PackTensor, ctx: ModuleContext<'_>) -> PackTensor
Adapt a tensor given where in the module hierarchy it was found. Read more
Source§fn get_alternative_param_name(
&self,
param_name: &str,
container_type: &str,
) -> Option<String>
fn get_alternative_param_name( &self, param_name: &str, container_type: &str, ) -> Option<String>
Get alternative parameter name to try during matching Read more
Source§fn clone_box(&self) -> Box<dyn ModuleAdapter>
fn clone_box(&self) -> Box<dyn ModuleAdapter>
Clone the adapter into a boxed trait object
Source§fn chain<A>(self, next: A) -> ChainAdapterwhere
Self: Sized + 'static,
A: ModuleAdapter + 'static,
fn chain<A>(self, next: A) -> ChainAdapterwhere
Self: Sized + 'static,
A: ModuleAdapter + 'static,
Auto Trait Implementations§
impl Freeze for PyTorchToBurnAdapter
impl RefUnwindSafe for PyTorchToBurnAdapter
impl Send for PyTorchToBurnAdapter
impl Sync for PyTorchToBurnAdapter
impl Unpin for PyTorchToBurnAdapter
impl UnsafeUnpin for PyTorchToBurnAdapter
impl UnwindSafe for PyTorchToBurnAdapter
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