pub trait Tape<E: Unit, D: DeviceStorage>: Default + Merge<Self> + Merge<NoneTape> {
const OWNS_TAPE: bool;
// Required methods
fn add_backward_op<F>(&mut self, operation: F)
where F: 'static + FnOnce(&mut Gradients<E, D>) -> Result<(), D::Err>;
fn try_alloc_grad<S: Shape>(
&mut self,
t: &Tensor<S, E, D>
) -> Result<(), D::Err>;
}
Expand description
Something that can track backward operations.