Expand description
Fields
modules: [T; N]
Trait Implementations
sourceimpl<T: CanUpdateWithGradients, const N: usize> CanUpdateWithGradients for Repeated<T, N>
impl<T: CanUpdateWithGradients, const N: usize> CanUpdateWithGradients for Repeated<T, N>
sourcefn update<G: GradientProvider>(
&mut self,
grads: &mut G,
unused: &mut UnusedTensors
)
fn update<G: GradientProvider>(
&mut self,
grads: &mut G,
unused: &mut UnusedTensors
)
Updates self given the GradientProvider. When any parameters that
are NOT present in G
, then this function should
add the tensor’s UniqueId to UnusedTensors. Read more
sourceimpl<T: LoadFromNpz, const N: usize> LoadFromNpz for Repeated<T, N>
impl<T: LoadFromNpz, const N: usize> LoadFromNpz for Repeated<T, N>
sourcefn read<R>(&mut self, base: &str, r: &mut ZipArchive<R>) -> Result<(), NpzError> where
R: Read + Seek,
fn read<R>(&mut self, base: &str, r: &mut ZipArchive<R>) -> Result<(), NpzError> where
R: Read + Seek,
Calls LoadFromNpz::read(self.modules[i], ...)
on each sub module. See LoadFromNpz.
E.g. for a two items with base == ""
, this will call:
self.modules[0].read("0.", r)
self.modules[1].read("1.", r)
sourceimpl<Input, T: Module<Input, Output = Input>, const N: usize> Module<Input> for Repeated<T, N>
impl<Input, T: Module<Input, Output = Input>, const N: usize> Module<Input> for Repeated<T, N>
sourcefn forward(&self, x: Input) -> Self::Output
fn forward(&self, x: Input) -> Self::Output
Pass an Input
through the unit and produce Self::Output.
Can be implemented for multiple Input
types. Read more
sourcefn forward_mut(&mut self, input: Input) -> Self::Output
fn forward_mut(&mut self, input: Input) -> Self::Output
Pass an Input
through the unit and produce Self::Output.
Can be implemented for multiple Input
types. Read more
sourceimpl<T: ResetParams, const N: usize> ResetParams for Repeated<T, N>
impl<T: ResetParams, const N: usize> ResetParams for Repeated<T, N>
sourceimpl<T: SaveToNpz, const N: usize> SaveToNpz for Repeated<T, N>
impl<T: SaveToNpz, const N: usize> SaveToNpz for Repeated<T, N>
Auto Trait Implementations
impl<T, const N: usize> RefUnwindSafe for Repeated<T, N> where
T: RefUnwindSafe,
impl<T, const N: usize> Send for Repeated<T, N> where
T: Send,
impl<T, const N: usize> Sync for Repeated<T, N> where
T: Sync,
impl<T, const N: usize> Unpin for Repeated<T, N> where
T: Unpin,
impl<T, const N: usize> UnwindSafe for Repeated<T, N> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more