Skip to main content

Decompose

Trait Decompose 

Source
pub trait Decompose {
    type Decomposition;

    // Required methods
    fn compose(decomposition: Self::Decomposition) -> Self
       where Self: Sized;
    fn decompose(self) -> Self::Decomposition
       where Self: Sized;
    fn decompose_cloned(&self) -> Self::Decomposition;
}
Expand description

trait to decompose AI modules into components that implement other libraries’ traits

Required Associated Types§

Source

type Decomposition

the decomposed type

Required Methods§

Source

fn compose(decomposition: Self::Decomposition) -> Self
where Self: Sized,

recreates from the decomposition

Source

fn decompose(self) -> Self::Decomposition
where Self: Sized,

owned decomposition

Source

fn decompose_cloned(&self) -> Self::Decomposition

decomposition that copies data

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Decompose for ()

Source§

type Decomposition = ()

Source§

fn compose(decomposition: Self::Decomposition) -> Self

Source§

fn decompose(self) -> Self::Decomposition

Source§

fn decompose_cloned(&self) -> Self::Decomposition

Source§

impl Decompose for Range<usize>

Source§

type Decomposition = (usize, usize)

Source§

fn compose(decomposition: Self::Decomposition) -> Self

Source§

fn decompose(self) -> Self::Decomposition

Source§

fn decompose_cloned(&self) -> Self::Decomposition

Source§

impl Decompose for bool

Source§

type Decomposition = bool

Source§

fn compose(decomposition: Self::Decomposition) -> Self

Source§

fn decompose(self) -> Self::Decomposition

Source§

fn decompose_cloned(&self) -> Self::Decomposition

Source§

impl Decompose for char

Source§

type Decomposition = char

Source§

fn compose(decomposition: Self::Decomposition) -> Self

Source§

fn decompose(self) -> Self::Decomposition

Source§

fn decompose_cloned(&self) -> Self::Decomposition

Source§

impl Decompose for f32

Source§

type Decomposition = f32

Source§

fn compose(decomposition: Self::Decomposition) -> Self

Source§

fn decompose(self) -> Self::Decomposition

Source§

fn decompose_cloned(&self) -> Self::Decomposition

Source§

impl Decompose for f64

Source§

type Decomposition = f64

Source§

fn compose(decomposition: Self::Decomposition) -> Self

Source§

fn decompose(self) -> Self::Decomposition

Source§

fn decompose_cloned(&self) -> Self::Decomposition

Source§

impl Decompose for i8

Source§

type Decomposition = i8

Source§

fn compose(decomposition: Self::Decomposition) -> Self

Source§

fn decompose(self) -> Self::Decomposition

Source§

fn decompose_cloned(&self) -> Self::Decomposition

Source§

impl Decompose for i16

Source§

type Decomposition = i16

Source§

fn compose(decomposition: Self::Decomposition) -> Self

Source§

fn decompose(self) -> Self::Decomposition

Source§

fn decompose_cloned(&self) -> Self::Decomposition

Source§

impl Decompose for i32

Source§

type Decomposition = i32

Source§

fn compose(decomposition: Self::Decomposition) -> Self

Source§

fn decompose(self) -> Self::Decomposition

Source§

fn decompose_cloned(&self) -> Self::Decomposition

Source§

impl Decompose for i64

Source§

type Decomposition = i64

Source§

fn compose(decomposition: Self::Decomposition) -> Self

Source§

fn decompose(self) -> Self::Decomposition

Source§

fn decompose_cloned(&self) -> Self::Decomposition

Source§

impl Decompose for i128

Source§

type Decomposition = i128

Source§

fn compose(decomposition: Self::Decomposition) -> Self

Source§

fn decompose(self) -> Self::Decomposition

Source§

fn decompose_cloned(&self) -> Self::Decomposition

Source§

impl Decompose for isize

Source§

type Decomposition = isize

Source§

fn compose(decomposition: Self::Decomposition) -> Self

Source§

fn decompose(self) -> Self::Decomposition

Source§

fn decompose_cloned(&self) -> Self::Decomposition

Source§

impl Decompose for u8

Source§

type Decomposition = u8

Source§

fn compose(decomposition: Self::Decomposition) -> Self

Source§

fn decompose(self) -> Self::Decomposition

Source§

fn decompose_cloned(&self) -> Self::Decomposition

Source§

impl Decompose for u16

Source§

type Decomposition = u16

Source§

fn compose(decomposition: Self::Decomposition) -> Self

Source§

fn decompose(self) -> Self::Decomposition

Source§

fn decompose_cloned(&self) -> Self::Decomposition

Source§

impl Decompose for u32

Source§

type Decomposition = u32

Source§

fn compose(decomposition: Self::Decomposition) -> Self

Source§

fn decompose(self) -> Self::Decomposition

Source§

fn decompose_cloned(&self) -> Self::Decomposition

Source§

impl Decompose for u64

Source§

type Decomposition = u64

Source§

fn compose(decomposition: Self::Decomposition) -> Self

Source§

fn decompose(self) -> Self::Decomposition

Source§

fn decompose_cloned(&self) -> Self::Decomposition

Source§

impl Decompose for u128

Source§

type Decomposition = u128

Source§

fn compose(decomposition: Self::Decomposition) -> Self

Source§

fn decompose(self) -> Self::Decomposition

Source§

fn decompose_cloned(&self) -> Self::Decomposition

Source§

impl Decompose for usize

Source§

type Decomposition = usize

Source§

fn compose(decomposition: Self::Decomposition) -> Self

Source§

fn decompose(self) -> Self::Decomposition

Source§

fn decompose_cloned(&self) -> Self::Decomposition

Source§

impl<A: Decompose, B: Decompose, C: Decompose, D: Decompose, E: Decompose, F: Decompose, G: Decompose, H: Decompose> Decompose for (A, B, C, D, E, F, G, H)

Source§

impl<A: Decompose, B: Decompose, C: Decompose, D: Decompose, E: Decompose, F: Decompose, G: Decompose> Decompose for (A, B, C, D, E, F, G)

Source§

impl<A: Decompose, B: Decompose, C: Decompose, D: Decompose, E: Decompose, F: Decompose> Decompose for (A, B, C, D, E, F)

Source§

impl<A: Decompose, B: Decompose, C: Decompose, D: Decompose, E: Decompose> Decompose for (A, B, C, D, E)

Source§

impl<A: Decompose, B: Decompose, C: Decompose, D: Decompose> Decompose for (A, B, C, D)

Source§

impl<A: Decompose, B: Decompose, C: Decompose> Decompose for (A, B, C)

Source§

impl<A: Decompose, B: Decompose> Decompose for (A, B)

Source§

impl<A: Decompose> Decompose for Option<A>

Source§

impl<A: Decompose> Decompose for Vec<A>

Source§

impl<K: Decompose + Eq + Hash, V: Decompose, S: Default + BuildHasher> Decompose for HashMap<K, V, S>
where K::Decomposition: Ord,

Implementors§

Source§

impl Decompose for AbnormalSoftmaxLayer

Source§

impl Decompose for AbsLayer

Source§

impl Decompose for AccQLayer

Source§

impl Decompose for AddLayer

Source§

impl Decompose for Alignment

Source§

impl Decompose for CatLayer

Source§

impl Decompose for ChooseLayer

Source§

impl Decompose for ClassificationLayer

Source§

impl Decompose for Config

Source§

impl Decompose for CrossEntropyLayer

Source§

impl Decompose for Label

Source§

impl Decompose for LogSoftmaxLayer

Source§

impl Decompose for MeanLayer

Source§

impl Decompose for MulLayer

Source§

impl Decompose for NegLayer

Source§

impl Decompose for OnMismatch

Source§

impl Decompose for ReductionMode

Source§

impl Decompose for RegressionLayer

Source§

impl Decompose for SoftmaxLayer

Source§

impl Decompose for SquaredErrorLayer

Source§

impl Decompose for SqueezeLayer

Source§

impl Decompose for StackLayer

Source§

impl Decompose for SumLayer

Source§

impl Decompose for UnsqueezeLayer

Source§

impl<A: Decompose, R: Clone + Decompose> Decompose for Flatten<A, R>

Source§

impl<A: Decompose, R: Clone + Decompose> Decompose for Reshape<A, R>

Source§

impl<A: Decompose, X, Y> Decompose for SetType<A, X, Y>

Source§

impl<A: Decompose, X: Decompose> Decompose for Autoregression<A, X>

Source§

impl<A: Decompose> Decompose for AbnormalSoftmax<A>

Source§

impl<A: Decompose> Decompose for Abs<A>

Source§

impl<A: Decompose> Decompose for AccQ<A>

Source§

impl<A: Decompose> Decompose for Add<A>

Source§

impl<A: Decompose> Decompose for Cat<A>

Source§

impl<A: Decompose> Decompose for Choose<A>

Source§

impl<A: Decompose> Decompose for Classification<A>

Source§

impl<A: Decompose> Decompose for CrossEntropy<A>

Source§

impl<A: Decompose> Decompose for Duplicate<A>

Source§

impl<A: Decompose> Decompose for Inner<A>

Source§

impl<A: Decompose> Decompose for LogSoftmax<A>

Source§

impl<A: Decompose> Decompose for Map<A>

Source§

impl<A: Decompose> Decompose for Mean<A>

Source§

impl<A: Decompose> Decompose for Mul<A>

Source§

impl<A: Decompose> Decompose for Neg<A>

Source§

impl<A: Decompose> Decompose for Regression<A>

Source§

impl<A: Decompose> Decompose for Residual<A>

Source§

impl<A: Decompose> Decompose for Sequential<A>

Source§

impl<A: Decompose> Decompose for Softmax<A>

Source§

impl<A: Decompose> Decompose for SquaredError<A>

Source§

impl<A: Decompose> Decompose for Squeeze<A>

Source§

impl<A: Decompose> Decompose for Stack<A>

Source§

impl<A: Decompose> Decompose for Sum<A>

Source§

impl<A: Decompose> Decompose for Unsqueeze<A>

Source§

impl<A: Decompose> Decompose for Unvec<A>

Source§

impl<A: Decompose> Decompose for Zip<A>

Source§

impl<B: Backend> Decompose for Identity<B>

Source§

impl<B: Backend> Decompose for Layer<B>

Source§

impl<B: Backend> Decompose for LossOutput<B>

Source§

impl<B: Backend> Decompose for Value<B>

Source§

impl<C: Decompose> Decompose for Graph<C>

Source§

impl<R: Clone + Decompose> Decompose for FlattenLayer<R>

Source§

impl<R: Clone + Decompose> Decompose for ReshapeLayer<R>

Source§

impl<W: Wrappable> Decompose for Wrapped<W>