pub trait SeqIterative {
    type State;

    fn initial_state(&self) -> Self::State;
    fn step(&self, state: &mut Self::State, input: &Tensor) -> Tensor;

    fn iter<I>(&self, inputs: I) -> SeqIterator<&Self, I::IntoIter>Notable traits for SeqIterator<M, I>impl<M, I> Iterator for SeqIterator<M, I> where
    M: SeqIterative,
    I: Iterator,
    I::Item: AsRef<Tensor>, 
type Item = Tensor;

    where
        I: IntoIterator,
        I::Item: AsRef<Tensor>
, { ... } fn into_iter<I>(self, inputs: I) -> SeqIterator<Self, I::IntoIter>Notable traits for SeqIterator<M, I>impl<M, I> Iterator for SeqIterator<M, I> where
    M: SeqIterative,
    I: Iterator,
    I::Item: AsRef<Tensor>, 
type Item = Tensor;

    where
        I: IntoIterator,
        I::Item: AsRef<Tensor>,
        Self: Sized
, { ... } }
Expand description

An iterative transformation of a sequence of input Tensor.

Required Associated Types

Sequence state managed by the module.

Required Methods

Construct an initial state for the start of a new sequence.

Transform the next value in the sequence.

Args
  • input - The input for one step. A tensor with shape [NUM_INPUT_FEATURES]
  • state - The policy hidden state.
Returns
  • output - The output tensor. Has shape [NUM_OUT_FEATURES]
  • state - A new value for the hidden state.

Provided Methods

Iterate over input tensors

Convert into an iterator over input tensors.

Implementations on Foreign Types

Implementors

Iterate over a sequence by independently and identically transforming each step.

Iterate over a sequence by independently and identically transforming each step.

Iterate over a sequence by independently and identically transforming each step.