pub struct Var<'a> { /* private fields */ }Expand description
A value recorded on an AAD Tape. Copyable and cheap; all
arithmetic allocates one tape node.
Implementations§
Source§impl<'a> Var<'a>
impl<'a> Var<'a>
pub fn value(self) -> f64
Sourcepub fn grad(self) -> Gradients
pub fn grad(self) -> Gradients
Backward sweep: the gradient of self with respect to every
variable on the tape (query via Gradients::wrt).
pub fn exp(self) -> Var<'a>
pub fn ln(self) -> Var<'a>
pub fn sqrt(self) -> Var<'a>
pub fn powf(self, n: f64) -> Var<'a>
pub fn sin(self) -> Var<'a>
pub fn cos(self) -> Var<'a>
Sourcepub fn max(self, other: Var<'a>) -> Var<'a>
pub fn max(self, other: Var<'a>) -> Var<'a>
max(self, other) with the one-sided subgradient at ties.
Trait Implementations§
impl<'a> Copy for Var<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Var<'a>
impl<'a> !Send for Var<'a>
impl<'a> !Sync for Var<'a>
impl<'a> !UnwindSafe for Var<'a>
impl<'a> Freeze for Var<'a>
impl<'a> Unpin for Var<'a>
impl<'a> UnsafeUnpin for Var<'a>
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