Struct candle_core::backprop::GradStore
source · pub struct GradStore(/* private fields */);
Expand description
A store for gradients, associating a tensor id to the corresponding gradient tensor, used for back propagation.
Implementations§
source§impl GradStore
impl GradStore
sourcepub fn get_id(&self, id: TensorId) -> Option<&Tensor>
pub fn get_id(&self, id: TensorId) -> Option<&Tensor>
Get the gradient tensor corresponding to the given tensor id
sourcepub fn get(&self, tensor: &Tensor) -> Option<&Tensor>
pub fn get(&self, tensor: &Tensor) -> Option<&Tensor>
Get the gradient tensor associated with the given tensor
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GradStore
impl !RefUnwindSafe for GradStore
impl Send for GradStore
impl Sync for GradStore
impl Unpin for GradStore
impl !UnwindSafe for GradStore
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