pub struct VariableGrad<T> {
pub grad: T,
pub computed: bool,
}Expand description
Gradient storage for a variable.
Fields§
§grad: TThe gradient tensor
computed: boolWhether the gradient has been computed
Implementations§
Source§impl<T> VariableGrad<T>
impl<T> VariableGrad<T>
Sourcepub fn placeholder(grad: T) -> Self
pub fn placeholder(grad: T) -> Self
Create an uncomputed gradient placeholder.
Trait Implementations§
Source§impl<T: Clone> Clone for VariableGrad<T>
impl<T: Clone> Clone for VariableGrad<T>
Source§fn clone(&self) -> VariableGrad<T>
fn clone(&self) -> VariableGrad<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for VariableGrad<T>where
T: Freeze,
impl<T> RefUnwindSafe for VariableGrad<T>where
T: RefUnwindSafe,
impl<T> Send for VariableGrad<T>where
T: Send,
impl<T> Sync for VariableGrad<T>where
T: Sync,
impl<T> Unpin for VariableGrad<T>where
T: Unpin,
impl<T> UnwindSafe for VariableGrad<T>where
T: UnwindSafe,
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