pub struct Tape {
pub actions: Vec<Box<dyn TapeAction>>,
}Expand description
The linear log of operations required to compute gradients.
Fields§
§actions: Vec<Box<dyn TapeAction>>Implementations§
Source§impl Tape
impl Tape
pub fn new() -> Self
Sourcepub fn push(&mut self, action: Box<dyn TapeAction>)
pub fn push(&mut self, action: Box<dyn TapeAction>)
Appends a new operation to the history log.
Sourcepub fn take_all(&mut self) -> Vec<Box<dyn TapeAction>>
pub fn take_all(&mut self) -> Vec<Box<dyn TapeAction>>
Extracts the entire history log, leaving the Tape completely empty. This is called right before executing the backward pass.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tape
impl !RefUnwindSafe for Tape
impl !Send for Tape
impl !Sync for Tape
impl Unpin for Tape
impl UnsafeUnpin for Tape
impl !UnwindSafe for Tape
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more