pub trait RevModule<X>: Module<X> {
type SelfGrads: Gradients;
// Required methods
fn reverse(
&self,
inputs: &X,
grads_wrt_output: &<Self as Module<X>>::Output,
) -> (X, Self::SelfGrads);
fn apply(
&mut self,
applyer: &mut impl GradApplyer,
updates: Self::SelfGrads,
) -> Result<(), Error>;
}
Expand description
A unit of computation which can do backpropagation without knowledge of any additional state.
This trait is to be implemented by individual network layers, but not compositions of them.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.