pub struct Tape<T> { /* private fields */ }Expand description
The computation tape that records operations for reverse-mode AD.
Create a tape with Tape::new, then create variables on it with
Tape::var.
§Examples
use autodiff::Tape;
let tape = Tape::new();
let x = tape.var(3.0);
let y = x.clone() * x.clone(); // y = x²
let grads = y.backward();
assert_eq!(y.value(), 9.0);
assert_eq!(grads.get(&x), 6.0); // dy/dx = 2x = 6Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Tape<T>
impl<T> !RefUnwindSafe for Tape<T>
impl<T> !Send for Tape<T>
impl<T> !Sync for Tape<T>
impl<T> Unpin for Tape<T>
impl<T> !UnwindSafe for Tape<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more