Trait dfdx::gradients::CanUpdateWithGradients
source · [−]pub trait CanUpdateWithGradients {
fn update<G: GradientProvider>(
&mut self,
grads: &mut G,
unused: &mut UnusedTensors
);
}
Expand description
Represents something that can be updated with GradientProvider.
Most implementations of this trait will have sub structs that also implement CanUpdateWithGradients.
Required Methods
sourcefn update<G: GradientProvider>(
&mut self,
grads: &mut G,
unused: &mut UnusedTensors
)
fn update<G: GradientProvider>(
&mut self,
grads: &mut G,
unused: &mut UnusedTensors
)
Updates self given the GradientProvider. When any parameters that
are NOT present in G
, then this function should
add the tensor’s UniqueId to UnusedTensors.