Trait dfdx::nn::ModuleMut

source ·
pub trait ModuleMut<Input> {
    type Output;
    type Error: Debug;

    // Required method
    fn try_forward_mut(
        &mut self,
        input: Input
    ) -> Result<Self::Output, Self::Error>;

    // Provided method
    fn forward_mut(&mut self, input: Input) -> Self::Output { ... }
}
Expand description

Mutable forward of Input that produces ModuleMut::Output. See Module for immutable forward.

Required Associated Types§

source

type Output

The type that this unit produces given Input.

source

type Error: Debug

Required Methods§

source

fn try_forward_mut(&mut self, input: Input) -> Result<Self::Output, Self::Error>

Provided Methods§

source

fn forward_mut(&mut self, input: Input) -> Self::Output

Forward Input through the module and produce ModuleMut::Output.

See Module::forward() for immutable version

Implementations on Foreign Types§

source§

impl<Input, M5: ModuleMut<M4::Output, Error = M4::Error>, M4: ModuleMut<M3::Output, Error = M3::Error>, M3: ModuleMut<M2::Output, Error = M2::Error>, M2: ModuleMut<M1::Output, Error = M1::Error>, M1: ModuleMut<Input>> ModuleMut<Input> for (M1, M2, M3, M4, M5)

source§

fn try_forward_mut(&mut self, x: Input) -> Result<Self::Output, Self::Error>

Calls forward sequentially on each module in the tuple.

§

type Output = <M5 as ModuleMut<<M4 as ModuleMut<<M3 as ModuleMut<<M2 as ModuleMut<<M1 as ModuleMut<Input>>::Output>>::Output>>::Output>>::Output>>::Output

§

type Error = <M5 as ModuleMut<<M4 as ModuleMut<<M3 as ModuleMut<<M2 as ModuleMut<<M1 as ModuleMut<Input>>::Output>>::Output>>::Output>>::Output>>::Error

source§

impl<Input, M3: ModuleMut<M2::Output, Error = M2::Error>, M2: ModuleMut<M1::Output, Error = M1::Error>, M1: ModuleMut<Input>> ModuleMut<Input> for (M1, M2, M3)

source§

fn try_forward_mut(&mut self, x: Input) -> Result<Self::Output, Self::Error>

Calls forward sequentially on each module in the tuple.

§

type Output = <M3 as ModuleMut<<M2 as ModuleMut<<M1 as ModuleMut<Input>>::Output>>::Output>>::Output

§

type Error = <M3 as ModuleMut<<M2 as ModuleMut<<M1 as ModuleMut<Input>>::Output>>::Output>>::Error

source§

impl<Input, M6: ModuleMut<M5::Output, Error = M5::Error>, M5: ModuleMut<M4::Output, Error = M4::Error>, M4: ModuleMut<M3::Output, Error = M3::Error>, M3: ModuleMut<M2::Output, Error = M2::Error>, M2: ModuleMut<M1::Output, Error = M1::Error>, M1: ModuleMut<Input>> ModuleMut<Input> for (M1, M2, M3, M4, M5, M6)

source§

fn try_forward_mut(&mut self, x: Input) -> Result<Self::Output, Self::Error>

Calls forward sequentially on each module in the tuple.

§

type Output = <M6 as ModuleMut<<M5 as ModuleMut<<M4 as ModuleMut<<M3 as ModuleMut<<M2 as ModuleMut<<M1 as ModuleMut<Input>>::Output>>::Output>>::Output>>::Output>>::Output>>::Output

§

type Error = <M6 as ModuleMut<<M5 as ModuleMut<<M4 as ModuleMut<<M3 as ModuleMut<<M2 as ModuleMut<<M1 as ModuleMut<Input>>::Output>>::Output>>::Output>>::Output>>::Output>>::Error

source§

impl<Input, M2: ModuleMut<M1::Output, Error = M1::Error>, M1: ModuleMut<Input>> ModuleMut<Input> for (M1, M2)

source§

fn try_forward_mut(&mut self, x: Input) -> Result<Self::Output, Self::Error>

Calls forward sequentially on each module in the tuple.

§

type Output = <M2 as ModuleMut<<M1 as ModuleMut<Input>>::Output>>::Output

§

type Error = <M2 as ModuleMut<<M1 as ModuleMut<Input>>::Output>>::Error

source§

impl<Input, M4: ModuleMut<M3::Output, Error = M3::Error>, M3: ModuleMut<M2::Output, Error = M2::Error>, M2: ModuleMut<M1::Output, Error = M1::Error>, M1: ModuleMut<Input>> ModuleMut<Input> for (M1, M2, M3, M4)

source§

fn try_forward_mut(&mut self, x: Input) -> Result<Self::Output, Self::Error>

Calls forward sequentially on each module in the tuple.

§

type Output = <M4 as ModuleMut<<M3 as ModuleMut<<M2 as ModuleMut<<M1 as ModuleMut<Input>>::Output>>::Output>>::Output>>::Output

§

type Error = <M4 as ModuleMut<<M3 as ModuleMut<<M2 as ModuleMut<<M1 as ModuleMut<Input>>::Output>>::Output>>::Output>>::Error

Implementors§

source§

impl<B: Dim, const C: usize, E: Dtype, D: Device<E>> ModuleMut<Tensor<(B, Const<C>), E, D, OwnedTape<E, D>>> for BatchNorm1D<C, E, D>

§

type Output = Tensor<(B, Const<C>), E, D, OwnedTape<E, D>>

§

type Error = <D as HasErr>::Err

source§

impl<B: Dim, const C: usize, H: Dim, W: Dim, E: Dtype, D: Device<E>> ModuleMut<Tensor<(B, Const<C>, H, W), E, D, OwnedTape<E, D>>> for BatchNorm2D<C, E, D>

§

type Output = Tensor<(B, Const<C>, H, W), E, D, OwnedTape<E, D>>

§

type Error = <D as HasErr>::Err

source§

impl<B: Dim, const C: usize, L: Dim, E: Dtype, D: Device<E>> ModuleMut<Tensor<(B, Const<C>, L), E, D, OwnedTape<E, D>>> for BatchNorm1D<C, E, D>

§

type Output = Tensor<(B, Const<C>, L), E, D, OwnedTape<E, D>>

§

type Error = <D as HasErr>::Err

source§

impl<Input, T: ModuleMut<Input, Output = Input>, const N: usize> ModuleMut<Input> for Repeated<T, N>

§

type Output = <T as ModuleMut<Input>>::Output

§

type Error = <T as ModuleMut<Input>>::Error

source§

impl<Input: SplitTape, A: ModuleMut<Input, Error = B::Error>, B: ModuleMut<Input>> ModuleMut<Input> for SplitInto<(A, B)>where A::Output: SplitTape<Tape = Input::Tape>,

§

type Output = (<<A as ModuleMut<Input>>::Output as SplitTape>::NoTape, <B as ModuleMut<Input>>::Output)

§

type Error = <B as ModuleMut<Input>>::Error

source§

impl<Input: SplitTape, A: ModuleMut<Input, Error = C::Error>, B: ModuleMut<Input, Error = C::Error>, C: ModuleMut<Input>> ModuleMut<Input> for SplitInto<(A, B, C)>where A::Output: SplitTape<Tape = Input::Tape>, B::Output: SplitTape<Tape = Input::Tape>,

§

type Output = (<<A as ModuleMut<Input>>::Output as SplitTape>::NoTape, <<B as ModuleMut<Input>>::Output as SplitTape>::NoTape, <C as ModuleMut<Input>>::Output)

§

type Error = <C as ModuleMut<Input>>::Error

source§

impl<Input: SplitTape, A: ModuleMut<Input, Error = D::Error>, B: ModuleMut<Input, Error = D::Error>, C: ModuleMut<Input, Error = D::Error>, D: ModuleMut<Input>> ModuleMut<Input> for SplitInto<(A, B, C, D)>where A::Output: SplitTape<Tape = Input::Tape>, B::Output: SplitTape<Tape = Input::Tape>, C::Output: SplitTape<Tape = Input::Tape>,

§

type Output = (<<A as ModuleMut<Input>>::Output as SplitTape>::NoTape, <<B as ModuleMut<Input>>::Output as SplitTape>::NoTape, <<C as ModuleMut<Input>>::Output as SplitTape>::NoTape, <D as ModuleMut<Input>>::Output)

§

type Error = <D as ModuleMut<Input>>::Error

source§

impl<Input: SplitTape, A: ModuleMut<Input, Error = E::Error>, B: ModuleMut<Input, Error = E::Error>, C: ModuleMut<Input, Error = E::Error>, D: ModuleMut<Input, Error = E::Error>, E: ModuleMut<Input>> ModuleMut<Input> for SplitInto<(A, B, C, D, E)>where A::Output: SplitTape<Tape = Input::Tape>, B::Output: SplitTape<Tape = Input::Tape>, C::Output: SplitTape<Tape = Input::Tape>, D::Output: SplitTape<Tape = Input::Tape>,

§

type Output = (<<A as ModuleMut<Input>>::Output as SplitTape>::NoTape, <<B as ModuleMut<Input>>::Output as SplitTape>::NoTape, <<C as ModuleMut<Input>>::Output as SplitTape>::NoTape, <<D as ModuleMut<Input>>::Output as SplitTape>::NoTape, <E as ModuleMut<Input>>::Output)

§

type Error = <E as ModuleMut<Input>>::Error

source§

impl<Input: SplitTape, A: ModuleMut<Input, Error = F::Error>, B: ModuleMut<Input, Error = F::Error>, C: ModuleMut<Input, Error = F::Error>, D: ModuleMut<Input, Error = F::Error>, E: ModuleMut<Input, Error = F::Error>, F: ModuleMut<Input>> ModuleMut<Input> for SplitInto<(A, B, C, D, E, F)>where A::Output: SplitTape<Tape = Input::Tape>, B::Output: SplitTape<Tape = Input::Tape>, C::Output: SplitTape<Tape = Input::Tape>, D::Output: SplitTape<Tape = Input::Tape>, E::Output: SplitTape<Tape = Input::Tape>,

§

type Output = (<<A as ModuleMut<Input>>::Output as SplitTape>::NoTape, <<B as ModuleMut<Input>>::Output as SplitTape>::NoTape, <<C as ModuleMut<Input>>::Output as SplitTape>::NoTape, <<D as ModuleMut<Input>>::Output as SplitTape>::NoTape, <<E as ModuleMut<Input>>::Output as SplitTape>::NoTape, <F as ModuleMut<Input>>::Output)

§

type Error = <F as ModuleMut<Input>>::Error

source§

impl<M: NonMutableModule, T> ModuleMut<T> for Mwhere Self: Module<T>,

§

type Output = <M as Module<T>>::Output

§

type Error = <M as Module<T>>::Error

source§

impl<Out: Add<Out, Output = Out>, Ai, Bi, A: ModuleMut<Ai, Output = Out>, B: ModuleMut<Bi, Output = Out, Error = A::Error>> ModuleMut<(Ai, Bi)> for AddInto<(A, B)>

§

type Output = Out

§

type Error = <A as ModuleMut<Ai>>::Error

source§

impl<Out: Add<Out, Output = Out>, Ai, Bi, Ci, A: ModuleMut<Ai, Output = Out>, B: ModuleMut<Bi, Output = Out, Error = A::Error>, C: ModuleMut<Ci, Output = Out, Error = A::Error>> ModuleMut<(Ai, Bi, Ci)> for AddInto<(A, B, C)>

§

type Output = Out

§

type Error = <A as ModuleMut<Ai>>::Error

source§

impl<Out: Add<Out, Output = Out>, Ai, Bi, Ci, Di, A: ModuleMut<Ai, Output = Out>, B: ModuleMut<Bi, Output = Out, Error = A::Error>, C: ModuleMut<Ci, Output = Out, Error = A::Error>, D: ModuleMut<Di, Output = Out, Error = A::Error>> ModuleMut<(Ai, Bi, Ci, Di)> for AddInto<(A, B, C, D)>

§

type Output = Out

§

type Error = <A as ModuleMut<Ai>>::Error

source§

impl<Out: Add<Out, Output = Out>, Ai, Bi, Ci, Di, Ei, A: ModuleMut<Ai, Output = Out>, B: ModuleMut<Bi, Output = Out, Error = A::Error>, C: ModuleMut<Ci, Output = Out, Error = A::Error>, D: ModuleMut<Di, Output = Out, Error = A::Error>, E: ModuleMut<Ei, Output = Out, Error = A::Error>> ModuleMut<(Ai, Bi, Ci, Di, Ei)> for AddInto<(A, B, C, D, E)>

§

type Output = Out

§

type Error = <A as ModuleMut<Ai>>::Error

source§

impl<Out: Add<Out, Output = Out>, Ai, Bi, Ci, Di, Ei, Fi, A: ModuleMut<Ai, Output = Out>, B: ModuleMut<Bi, Output = Out, Error = A::Error>, C: ModuleMut<Ci, Output = Out, Error = A::Error>, D: ModuleMut<Di, Output = Out, Error = A::Error>, E: ModuleMut<Ei, Output = Out, Error = A::Error>, F: ModuleMut<Fi, Output = Out, Error = A::Error>> ModuleMut<(Ai, Bi, Ci, Di, Ei, Fi)> for AddInto<(A, B, C, D, E, F)>

§

type Output = Out

§

type Error = <A as ModuleMut<Ai>>::Error

source§

impl<S: Shape, E: Dtype, D: Device<E>> ModuleMut<Tensor<S, E, D, OwnedTape<E, D>>> for Dropout

§

type Output = Tensor<S, E, D, OwnedTape<E, D>>

§

type Error = <D as HasErr>::Err

source§

impl<T: WithEmptyTape + TryAdd<T>, F: ModuleMut<T, Output = T, Error = T::Err>> ModuleMut<T> for Residual<F>

§

type Output = T

§

type Error = <F as ModuleMut<T>>::Error

source§

impl<T: WithEmptyTape, F: ModuleMut<T>, R: ModuleMut<T, Output = F::Output, Error = F::Error>> ModuleMut<T> for GeneralizedResidual<F, R>where F::Output: TryAdd<F::Output> + HasErr<Err = F::Error>,

§

type Output = <F as ModuleMut<T>>::Output

§

type Error = <F as ModuleMut<T>>::Error

source§

impl<const C: usize, H: Dim, W: Dim, E: Dtype, D: Device<E>> ModuleMut<Tensor<(Const<C>, H, W), E, D, OwnedTape<E, D>>> for BatchNorm2D<C, E, D>

§

type Output = Tensor<(Const<C>, H, W), E, D, OwnedTape<E, D>>

§

type Error = <D as HasErr>::Err

source§

impl<const N: usize, S: Shape, E: Dtype, D: Device<E>> ModuleMut<Tensor<S, E, D, OwnedTape<E, D>>> for DropoutOneIn<N>

§

type Output = Tensor<S, E, D, OwnedTape<E, D>>

§

type Error = <D as HasErr>::Err