pub struct Duplicate<A> { /* private fields */ }Expand description
module for cloning things
Implementations§
Source§impl<A> Duplicate<A>
impl<A> Duplicate<A>
Sourcepub fn into_inner(self) -> A
pub fn into_inner(self) -> A
returns the inner value
Sourcepub fn from_inner(inner: A) -> Self
pub fn from_inner(inner: A) -> Self
creates a new duplicate module from the inner value
Sourcepub fn with_inner<B>(&self, inner: B) -> Duplicate<B>
pub fn with_inner<B>(&self, inner: B) -> Duplicate<B>
replaces the inner value
Sourcepub fn with_times(self, times: usize) -> Self
pub fn with_times(self, times: usize) -> Self
sets the suggested number of times to duplicate for a variable sized output like a vec. fixed array outputs of other lengths will still be allowed
Trait Implementations§
Source§impl<A: AI<X, Y>, X, Y: Clone> AI<X, (Y, Y, Y, Y)> for Duplicate<A>
impl<A: AI<X, Y>, X, Y: Clone> AI<X, (Y, Y, Y, Y)> for Duplicate<A>
Source§fn forward(&self, input: X) -> (Y, Y, Y, Y)
fn forward(&self, input: X) -> (Y, Y, Y, Y)
applies to the input
Source§fn forward_mut(&mut self, input: X) -> (Y, Y, Y, Y)
fn forward_mut(&mut self, input: X) -> (Y, Y, Y, Y)
applies to the input, possibly updating internal caches
Source§impl<A: AI<X, Y>, X, Y: Clone> AI<X, (Y, Y, Y, Y, Y)> for Duplicate<A>
impl<A: AI<X, Y>, X, Y: Clone> AI<X, (Y, Y, Y, Y, Y)> for Duplicate<A>
Source§fn forward(&self, input: X) -> (Y, Y, Y, Y, Y)
fn forward(&self, input: X) -> (Y, Y, Y, Y, Y)
applies to the input
Source§fn forward_mut(&mut self, input: X) -> (Y, Y, Y, Y, Y)
fn forward_mut(&mut self, input: X) -> (Y, Y, Y, Y, Y)
applies to the input, possibly updating internal caches
Source§impl<A: AI<X, Y>, X, Y: Clone> AI<X, (Y, Y, Y, Y, Y, Y)> for Duplicate<A>
impl<A: AI<X, Y>, X, Y: Clone> AI<X, (Y, Y, Y, Y, Y, Y)> for Duplicate<A>
Source§fn forward(&self, input: X) -> (Y, Y, Y, Y, Y, Y)
fn forward(&self, input: X) -> (Y, Y, Y, Y, Y, Y)
applies to the input
Source§fn forward_mut(&mut self, input: X) -> (Y, Y, Y, Y, Y, Y)
fn forward_mut(&mut self, input: X) -> (Y, Y, Y, Y, Y, Y)
applies to the input, possibly updating internal caches
Source§impl<A: AI<X, Y>, X, Y: Clone> AI<X, (Y, Y, Y, Y, Y, Y, Y)> for Duplicate<A>
impl<A: AI<X, Y>, X, Y: Clone> AI<X, (Y, Y, Y, Y, Y, Y, Y)> for Duplicate<A>
Source§fn forward(&self, input: X) -> (Y, Y, Y, Y, Y, Y, Y)
fn forward(&self, input: X) -> (Y, Y, Y, Y, Y, Y, Y)
applies to the input
Source§fn forward_mut(&mut self, input: X) -> (Y, Y, Y, Y, Y, Y, Y)
fn forward_mut(&mut self, input: X) -> (Y, Y, Y, Y, Y, Y, Y)
applies to the input, possibly updating internal caches
Source§impl<A: AI<X, Y>, X, Y: Clone> AI<X, (Y, Y, Y, Y, Y, Y, Y, Y)> for Duplicate<A>
impl<A: AI<X, Y>, X, Y: Clone> AI<X, (Y, Y, Y, Y, Y, Y, Y, Y)> for Duplicate<A>
Source§fn forward(&self, input: X) -> (Y, Y, Y, Y, Y, Y, Y, Y)
fn forward(&self, input: X) -> (Y, Y, Y, Y, Y, Y, Y, Y)
applies to the input
Source§fn forward_mut(&mut self, input: X) -> (Y, Y, Y, Y, Y, Y, Y, Y)
fn forward_mut(&mut self, input: X) -> (Y, Y, Y, Y, Y, Y, Y, Y)
applies to the input, possibly updating internal caches
Source§impl<A: Decompose> Decompose for Duplicate<A>
impl<A: Decompose> Decompose for Duplicate<A>
Source§type Decomposition = (<A as Decompose>::Decomposition, usize)
type Decomposition = (<A as Decompose>::Decomposition, usize)
the decomposed type
Source§fn compose((inner, times): Self::Decomposition) -> Self
fn compose((inner, times): Self::Decomposition) -> Self
recreates from the decomposition
Source§fn decompose(self) -> Self::Decomposition
fn decompose(self) -> Self::Decomposition
owned decomposition
Source§fn decompose_cloned(&self) -> Self::Decomposition
fn decompose_cloned(&self) -> Self::Decomposition
decomposition that copies data
Source§impl<'de, A> Deserialize<'de> for Duplicate<A>where
A: Deserialize<'de>,
impl<'de, A> Deserialize<'de> for Duplicate<A>where
A: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<A: IntoSequence<M>, M: AI<M::Output, M::Output> + Op> IntoSequence<M> for Duplicate<A>
impl<A: IntoSequence<M>, M: AI<M::Output, M::Output> + Op> IntoSequence<M> for Duplicate<A>
Source§fn into_sequence(self) -> Sequential<Vec<M>>
fn into_sequence(self) -> Sequential<Vec<M>>
converts into a sequential module list
Source§impl<A: Op<Output = Y>, Y> Op for Duplicate<A>
impl<A: Op<Output = Y>, Y> Op for Duplicate<A>
Source§type Output = (Y, Y)
type Output = (Y, Y)
suggested output type to help with composition coherence. Ideally, Self should implement AI<X,Self::Output> for some X
Source§fn chain<B>(self, b: B) -> Sequential<(Self, B)>
fn chain<B>(self, b: B) -> Sequential<(Self, B)>
sequences with another ai operation
Source§fn forward_fixed<Z>(&self, input: Z) -> Z
fn forward_fixed<Z>(&self, input: Z) -> Z
applies to the input
Source§fn forward_fixed_mut<Z>(&mut self, input: Z) -> Z
fn forward_fixed_mut<Z>(&mut self, input: Z) -> Z
applies to the input
Source§fn forward_typed<W, Z>(&self, input: W) -> Z
fn forward_typed<W, Z>(&self, input: W) -> Z
applies to the input
Source§fn forward_typed_mut<W, Z>(&mut self, input: W) -> Z
fn forward_typed_mut<W, Z>(&mut self, input: W) -> Z
applies to the input, possibly updating internal caches
Source§fn infer_autoregressive<X, Y>(self, input: X) -> Autoregression<Self, Y> ⓘ
fn infer_autoregressive<X, Y>(self, input: X) -> Autoregression<Self, Y> ⓘ
creates an autoregressive inference
Source§fn map<B>(self, b: B) -> Map<Sequential<(Self, B)>>
fn map<B>(self, b: B) -> Map<Sequential<(Self, B)>>
applies the operation to every output
Source§fn wrap_inner(self) -> Inner<Self>where
Self: Sized,
fn wrap_inner(self) -> Inner<Self>where
Self: Sized,
wraps the inner value so it can be unwrapped with unwrap inner
Source§impl<A: UnwrapInner> UnwrapInner for Duplicate<A>
impl<A: UnwrapInner> UnwrapInner for Duplicate<A>
Source§type Inner = <A as UnwrapInner>::Inner
type Inner = <A as UnwrapInner>::Inner
the inner type
Source§fn unwrap_inner(self) -> Self::Inner
fn unwrap_inner(self) -> Self::Inner
unwraps the inner value
impl<A: Copy> Copy for Duplicate<A>
Auto Trait Implementations§
impl<A> Freeze for Duplicate<A>where
A: Freeze,
impl<A> RefUnwindSafe for Duplicate<A>where
A: RefUnwindSafe,
impl<A> Send for Duplicate<A>where
A: Send,
impl<A> Sync for Duplicate<A>where
A: Sync,
impl<A> Unpin for Duplicate<A>where
A: Unpin,
impl<A> UnwindSafe for Duplicate<A>where
A: UnwindSafe,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Shortcuts for T
impl<T> Shortcuts for T
Source§fn classification(self) -> Classification<Self>
fn classification(self) -> Classification<Self>
wraps in a classification wrapper
Source§fn regression(self) -> Regression<Self>
fn regression(self) -> Regression<Self>
wraps in a regression wrapper