pub trait Module<'p, Input> {
type Output;
type Params: Parameters;
fn forward(&'p self, x: Input) -> Self::Output;
fn parameters(&'p mut self) -> Self::Params;
}Expand description
Module trait
Module can be implemented for anything that can have forward function. Forward simply takes any input, applies some operation and returns output. Every module also has some or zero parameters that can be optimized by optimizers.
Required Associated Types
sourcetype Params: Parameters
type Params: Parameters
Parameters of Module
Required Methods
sourcefn parameters(&'p mut self) -> Self::Params
fn parameters(&'p mut self) -> Self::Params
Get parameters of Module