pub trait AsModule {
type Module: Module;
// Required methods
fn as_module(&self) -> &Self::Module;
fn as_module_mut(&mut self) -> &mut Self::Module;
// Provided method
fn batch_map<F: Fn(Tensor) -> Tensor>(self, f: F) -> BatchMap<Self, F>
where Self: Sized { ... }
}
Expand description
A trait for module wrappers that allow borrowing the contained Module
.