pub struct GRU { /* private fields */ }
Expand description
A Gated Recurrent Unit (GRU) layer.
Implementations§
Trait Implementations§
Source§impl RNN for GRU
impl RNN for GRU
type State = GRUState
Source§fn zero_state(&self, batch_dim: usize) -> Result<Self::State>
fn zero_state(&self, batch_dim: usize) -> Result<Self::State>
A zero state from which the recurrent network is usually initialized.
Source§fn step(&self, input: &Tensor, in_state: &Self::State) -> Result<Self::State>
fn step(&self, input: &Tensor, in_state: &Self::State) -> Result<Self::State>
Applies a single step of the recurrent network. Read more
Source§fn states_to_tensor(&self, states: &[Self::State]) -> Result<Tensor>
fn states_to_tensor(&self, states: &[Self::State]) -> Result<Tensor>
Converts a sequence of state to a tensor.
Auto Trait Implementations§
impl Freeze for GRU
impl !RefUnwindSafe for GRU
impl Send for GRU
impl Sync for GRU
impl Unpin for GRU
impl !UnwindSafe for GRU
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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