pub trait Stack {
    type Remaining: Stack;
    type Head;

    fn pop(self) -> (Self::Remaining, Self::Head);
    fn map<F: FnOnce(&Self::Head) -> O, O>(&self, f: F) -> O;
    fn map_remaining<F: FnOnce(&Self::Remaining) -> O, O>(&self, f: F) -> O;
}
Expand description

Trait that defines a stack to store the results computed by forward propagation when training a neural network.

Required Associated Types

Stack containing elements that do not include the top element of the stack

Top element of the stack

Required Methods

Returns a tuple of the top item in the stack and the rest of the stack

Returns the result of applying the callback function to the top element of the stack

Arguments
  • f - Applicable callbacks

Returns the result of applying the callback to a stack that does not contain the top element of the stack

  • f - Applicable callbacks

Implementors