pub struct BurnToPyTorchAdapter;Expand description
Adapter for converting from Burn format to PyTorch format
Handles:
- Linear layer weight transposition (Burn: [in, out] -> PyTorch: [out, in])
- Normalization parameter renaming (gamma -> weight, beta -> bias)
Trait Implementations§
Source§impl Clone for BurnToPyTorchAdapter
impl Clone for BurnToPyTorchAdapter
Source§impl Debug for BurnToPyTorchAdapter
impl Debug for BurnToPyTorchAdapter
Source§impl Default for BurnToPyTorchAdapter
impl Default for BurnToPyTorchAdapter
Source§impl ModuleAdapter for BurnToPyTorchAdapter
impl ModuleAdapter for BurnToPyTorchAdapter
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 BurnToPyTorchAdapter
impl RefUnwindSafe for BurnToPyTorchAdapter
impl Send for BurnToPyTorchAdapter
impl Sync for BurnToPyTorchAdapter
impl Unpin for BurnToPyTorchAdapter
impl UnsafeUnpin for BurnToPyTorchAdapter
impl UnwindSafe for BurnToPyTorchAdapter
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