Skip to main content

Pullback

Trait Pullback 

Source
pub trait Pullback<OutputCotangent, InputCotangent> {
    type Error;

    // Required method
    fn apply(
        self,
        cotangent: OutputCotangent,
    ) -> Result<InputCotangent, Self::Error>;
}
Expand description

A one-shot reverse-mode pullback.

Consuming self permits a pullback to own a factorization, Krylov basis, checkpoint set, or device buffer and release it after one reverse application. A pullback may also borrow immutable primal inputs through the generic associated type on VjpRule.

Required Associated Types§

Source

type Error

Error returned by the reverse computation.

Required Methods§

Source

fn apply( self, cotangent: OutputCotangent, ) -> Result<InputCotangent, Self::Error>

Applies the pullback once.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F, OutputCotangent, InputCotangent, Error> Pullback<OutputCotangent, InputCotangent> for F
where F: FnOnce(OutputCotangent) -> Result<InputCotangent, Error>,

Source§

type Error = Error