pub struct ChainAdapter { /* private fields */ }Expand description
Adapter that applies two adapters in sequence.
This allows composing smaller adapters instead of creating one large monolithic adapter.
Implementations§
Source§impl ChainAdapter
impl ChainAdapter
Sourcepub fn new<A, B>(first: A, second: B) -> Selfwhere
A: ModuleAdapter + 'static,
B: ModuleAdapter + 'static,
pub fn new<A, B>(first: A, second: B) -> Selfwhere
A: ModuleAdapter + 'static,
B: ModuleAdapter + 'static,
Create a new adapter chain.
Trait Implementations§
Source§impl Clone for ChainAdapter
impl Clone for ChainAdapter
Source§impl ModuleAdapter for ChainAdapter
impl ModuleAdapter for ChainAdapter
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 !RefUnwindSafe for ChainAdapter
impl !UnwindSafe for ChainAdapter
impl Freeze for ChainAdapter
impl Send for ChainAdapter
impl Sync for ChainAdapter
impl Unpin for ChainAdapter
impl UnsafeUnpin for ChainAdapter
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