pub trait Backward<B, const N: usize>:
Send
+ Debug
+ Sized
+ 'staticwhere
B: Backend,{
type State: Clone + Send + Debug + 'static;
// Required method
fn backward(
self,
ops: Ops<Self::State, N>,
grads: &mut Gradients,
checkpointer: &mut Checkpointer,
);
// Provided method
fn prepare<C>(
self,
nodes: [Arc<Node>; N],
) -> OpsPrep<Self, B, Self::State, C, N>
where C: CheckpointStrategy { ... }
}
Expand description
Trait for all operations.
§Notes
Concrete types implementing this trait should not have any state. If a state is necessary during the backward pass, they should be declared with the associated type ‘State’.
Required Associated Types§
Required Methods§
fn backward(
self,
ops: Ops<Self::State, N>,
grads: &mut Gradients,
checkpointer: &mut Checkpointer,
)
fn backward( self, ops: Ops<Self::State, N>, grads: &mut Gradients, checkpointer: &mut Checkpointer, )
The backward pass.
Provided Methods§
Object Safety§
This trait is not object safe.