Trait dfdx::tensor::Tape

source ·
pub trait Tape<E, D: Storage<E>>: Default + Merge<Self> + Merge<NoneTape> {
    const OWNS_TAPE: bool;

    // Required method
    fn add_backward_op<F>(&mut self, operation: F)
       where F: 'static + FnOnce(&mut Gradients<E, D>) -> Result<(), D::Err>;
}
Expand description

Something that can track backward operations.

Required Associated Constants§

source

const OWNS_TAPE: bool

Whether this object is currently tracking gradients. This is known at compile time.

Required Methods§

source

fn add_backward_op<F>(&mut self, operation: F)where F: 'static + FnOnce(&mut Gradients<E, D>) -> Result<(), D::Err>,

Implementors§

source§

impl<E, D: Storage<E>> Tape<E, D> for NoneTape

source§

const OWNS_TAPE: bool = false

source§

impl<E, D: Storage<E>> Tape<E, D> for OwnedTape<E, D>

source§

const OWNS_TAPE: bool = true