pub trait Module<Input> {
type Output;
type Error: Debug;
// Required method
fn try_forward(&self, input: Input) -> Result<Self::Output, Self::Error>;
// Provided method
fn forward(&self, input: Input) -> Self::Output { ... }
}
Expand description
Immutable forward of Input
that produces Module::Output.
See ModuleMut for mutable forward.
Required Associated Types§
Required Methods§
fn try_forward(&self, input: Input) -> Result<Self::Output, Self::Error>
Provided Methods§
sourcefn forward(&self, input: Input) -> Self::Output
fn forward(&self, input: Input) -> Self::Output
Forward Input
through the module and produce Module::Output.
See ModuleMut::forward_mut() for version that can mutate self
.
Implementations on Foreign Types§
source§impl<Input, M4: Module<M3::Output, Error = M3::Error>, M3: Module<M2::Output, Error = M2::Error>, M2: Module<M1::Output, Error = M1::Error>, M1: Module<Input>> Module<Input> for (M1, M2, M3, M4)
impl<Input, M4: Module<M3::Output, Error = M3::Error>, M3: Module<M2::Output, Error = M2::Error>, M2: Module<M1::Output, Error = M1::Error>, M1: Module<Input>> Module<Input> for (M1, M2, M3, M4)
source§fn try_forward(&self, x: Input) -> Result<Self::Output, Self::Error>
fn try_forward(&self, x: Input) -> Result<Self::Output, Self::Error>
Calls forward sequentially on each module in the tuple.
type Output = <M4 as Module<<M3 as Module<<M2 as Module<<M1 as Module<Input>>::Output>>::Output>>::Output>>::Output
type Error = <M4 as Module<<M3 as Module<<M2 as Module<<M1 as Module<Input>>::Output>>::Output>>::Output>>::Error
source§impl<Input, M6: Module<M5::Output, Error = M5::Error>, M5: Module<M4::Output, Error = M4::Error>, M4: Module<M3::Output, Error = M3::Error>, M3: Module<M2::Output, Error = M2::Error>, M2: Module<M1::Output, Error = M1::Error>, M1: Module<Input>> Module<Input> for (M1, M2, M3, M4, M5, M6)
impl<Input, M6: Module<M5::Output, Error = M5::Error>, M5: Module<M4::Output, Error = M4::Error>, M4: Module<M3::Output, Error = M3::Error>, M3: Module<M2::Output, Error = M2::Error>, M2: Module<M1::Output, Error = M1::Error>, M1: Module<Input>> Module<Input> for (M1, M2, M3, M4, M5, M6)
source§fn try_forward(&self, x: Input) -> Result<Self::Output, Self::Error>
fn try_forward(&self, x: Input) -> Result<Self::Output, Self::Error>
Calls forward sequentially on each module in the tuple.
type Output = <M6 as Module<<M5 as Module<<M4 as Module<<M3 as Module<<M2 as Module<<M1 as Module<Input>>::Output>>::Output>>::Output>>::Output>>::Output>>::Output
type Error = <M6 as Module<<M5 as Module<<M4 as Module<<M3 as Module<<M2 as Module<<M1 as Module<Input>>::Output>>::Output>>::Output>>::Output>>::Output>>::Error
source§impl<Input, M2: Module<M1::Output, Error = M1::Error>, M1: Module<Input>> Module<Input> for (M1, M2)
impl<Input, M2: Module<M1::Output, Error = M1::Error>, M1: Module<Input>> Module<Input> for (M1, M2)
source§impl<Input, M5: Module<M4::Output, Error = M4::Error>, M4: Module<M3::Output, Error = M3::Error>, M3: Module<M2::Output, Error = M2::Error>, M2: Module<M1::Output, Error = M1::Error>, M1: Module<Input>> Module<Input> for (M1, M2, M3, M4, M5)
impl<Input, M5: Module<M4::Output, Error = M4::Error>, M4: Module<M3::Output, Error = M3::Error>, M3: Module<M2::Output, Error = M2::Error>, M2: Module<M1::Output, Error = M1::Error>, M1: Module<Input>> Module<Input> for (M1, M2, M3, M4, M5)
source§fn try_forward(&self, x: Input) -> Result<Self::Output, Self::Error>
fn try_forward(&self, x: Input) -> Result<Self::Output, Self::Error>
Calls forward sequentially on each module in the tuple.
type Output = <M5 as Module<<M4 as Module<<M3 as Module<<M2 as Module<<M1 as Module<Input>>::Output>>::Output>>::Output>>::Output>>::Output
type Error = <M5 as Module<<M4 as Module<<M3 as Module<<M2 as Module<<M1 as Module<Input>>::Output>>::Output>>::Output>>::Output>>::Error
source§impl<Input, M3: Module<M2::Output, Error = M2::Error>, M2: Module<M1::Output, Error = M1::Error>, M1: Module<Input>> Module<Input> for (M1, M2, M3)
impl<Input, M3: Module<M2::Output, Error = M2::Error>, M2: Module<M1::Output, Error = M1::Error>, M1: Module<Input>> Module<Input> for (M1, M2, M3)
source§fn try_forward(&self, x: Input) -> Result<Self::Output, Self::Error>
fn try_forward(&self, x: Input) -> Result<Self::Output, Self::Error>
Calls forward sequentially on each module in the tuple.