pub struct Var(/* private fields */);Implementations§
Source§impl Var
impl Var
Sourcepub fn leaf(t: Tensor) -> Var
pub fn leaf(t: Tensor) -> Var
A differentiable leaf (a parameter or input we want gradients for).
pub fn value(&self) -> &Tensor
pub fn grad(&self) -> Option<Tensor>
Sourcepub fn backward(&self)
pub fn backward(&self)
Backpropagate from this (scalar-ish) output: seed grad = ones, walk reverse-topo.
pub fn add(&self, o: &Var) -> Var
pub fn sub(&self, o: &Var) -> Var
pub fn mul(&self, o: &Var) -> Var
pub fn relu(&self) -> Var
pub fn sum_all(&self) -> Var
pub fn mean_all(&self) -> Var
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Var
impl !Send for Var
impl !Sync for Var
impl !UnwindSafe for Var
impl Freeze for Var
impl Unpin for Var
impl UnsafeUnpin for Var
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