Trait rai_core::GenericValue

source ·
pub trait GenericValue<Kind, Tensors, Gradient> {
    // Required methods
    fn gv_tensors(&self) -> Tensors;
    fn gv_grad(tensors: &Tensors, grad_map: &HashMap<usize, Tensor>) -> Gradient;
    fn gv_grad_map(
        tensors: &Tensors,
        grad: Gradient,
        out: &mut HashMap<usize, Tensor>
    );
}

Required Methods§

source

fn gv_tensors(&self) -> Tensors

source

fn gv_grad(tensors: &Tensors, grad_map: &HashMap<usize, Tensor>) -> Gradient

source

fn gv_grad_map( tensors: &Tensors, grad: Gradient, out: &mut HashMap<usize, Tensor> )

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl GenericValue<Basic, (), ()> for Option<bool>

source§

impl GenericValue<Basic, (), ()> for Option<f32>

source§

impl GenericValue<Basic, (), ()> for Option<f64>

source§

impl GenericValue<Basic, (), ()> for Option<i8>

source§

impl GenericValue<Basic, (), ()> for Option<i16>

source§

impl GenericValue<Basic, (), ()> for Option<i32>

source§

impl GenericValue<Basic, (), ()> for Option<i64>

source§

impl GenericValue<Basic, (), ()> for Option<i128>

source§

impl GenericValue<Basic, (), ()> for Option<isize>

source§

impl GenericValue<Basic, (), ()> for Option<u8>

source§

impl GenericValue<Basic, (), ()> for Option<u16>

source§

impl GenericValue<Basic, (), ()> for Option<u32>

source§

impl GenericValue<Basic, (), ()> for Option<u64>

source§

impl GenericValue<Basic, (), ()> for Option<u128>

source§

impl GenericValue<Basic, (), ()> for Option<()>

source§

impl GenericValue<Basic, (), ()> for Option<usize>

source§

impl GenericValue<Basic, (), ()> for Option<bf16>

source§

impl GenericValue<Basic, (), ()> for Option<f16>

source§

impl GenericValue<Basic, (), ()> for bool

source§

impl GenericValue<Basic, (), ()> for f32

source§

impl GenericValue<Basic, (), ()> for f64

source§

impl GenericValue<Basic, (), ()> for i8

source§

impl GenericValue<Basic, (), ()> for i16

source§

impl GenericValue<Basic, (), ()> for i32

source§

impl GenericValue<Basic, (), ()> for i64

source§

impl GenericValue<Basic, (), ()> for i128

source§

impl GenericValue<Basic, (), ()> for isize

source§

impl GenericValue<Basic, (), ()> for u8

source§

impl GenericValue<Basic, (), ()> for u16

source§

impl GenericValue<Basic, (), ()> for u32

source§

impl GenericValue<Basic, (), ()> for u64

source§

impl GenericValue<Basic, (), ()> for u128

source§

impl GenericValue<Basic, (), ()> for ()

source§

impl GenericValue<Basic, (), ()> for usize

source§

impl GenericValue<Basic, (), ()> for bf16

source§

impl GenericValue<Basic, (), ()> for f16

source§

impl GenericValue<Basic, HashMap<usize, Tensor>, HashMap<usize, Tensor>> for HashMap<usize, Tensor>

source§

impl<'a, A, T, G, X> GenericValue<Array<A>, T, G> for &'a X
where X: GenericValue<Array<A>, T, G>,

source§

fn gv_tensors(&self) -> T

source§

fn gv_grad(tensors: &T, grad_map: &HashMap<usize, Tensor>) -> G

source§

fn gv_grad_map(tensors: &T, grad: G, out: &mut HashMap<usize, Tensor>)

source§

impl<'a, A, T, G, X> GenericValue<Tuple<A>, T, G> for &'a X
where X: GenericValue<Tuple<A>, T, G>,

source§

fn gv_tensors(&self) -> T

source§

fn gv_grad(tensors: &T, grad_map: &HashMap<usize, Tensor>) -> G

source§

fn gv_grad_map(tensors: &T, grad: G, out: &mut HashMap<usize, Tensor>)

source§

impl<'a, T, G, X> GenericValue<Basic, T, G> for &'a X
where X: GenericValue<Basic, T, G>,

source§

fn gv_tensors(&self) -> T

source§

fn gv_grad(tensors: &T, grad_map: &HashMap<usize, Tensor>) -> G

source§

fn gv_grad_map(tensors: &T, grad: G, out: &mut HashMap<usize, Tensor>)

source§

impl<'a, T, G, X> GenericValue<Basic, T, G> for &'a mut X
where X: GenericValue<Basic, T, G>,

source§

fn gv_tensors(&self) -> T

source§

fn gv_grad(tensors: &T, grad_map: &HashMap<usize, Tensor>) -> G

source§

fn gv_grad_map(tensors: &T, grad: G, out: &mut HashMap<usize, Tensor>)

source§

impl<A> GenericValue<Tuple<(A,)>, <A as ValueSpec>::Tensors, <A as ValueSpec>::Gradient> for (A,)
where A: Value, A::Tensors: TensorIter,

source§

fn gv_tensors(&self) -> A::Tensors

source§

fn gv_grad( tensors: &A::Tensors, grad_map: &HashMap<usize, Tensor> ) -> A::Gradient

source§

fn gv_grad_map( tensors: &A::Tensors, grad: A::Gradient, out: &mut HashMap<usize, Tensor> )

source§

impl<A, B> GenericValue<Tuple<(A, B)>, (<A as ValueSpec>::Tensors, <B as ValueSpec>::Tensors), (<A as ValueSpec>::Gradient, <B as ValueSpec>::Gradient)> for (A, B)
where A: Value, B: Value, (A::Tensors, B::Tensors): TensorIter,

source§

fn gv_tensors(&self) -> (A::Tensors, B::Tensors)

source§

fn gv_grad( tensors: &(A::Tensors, B::Tensors), grad_map: &HashMap<usize, Tensor> ) -> (A::Gradient, B::Gradient)

source§

fn gv_grad_map( tensors: &(A::Tensors, B::Tensors), grad: (A::Gradient, B::Gradient), out: &mut HashMap<usize, Tensor> )

source§

impl<A, B, C> GenericValue<Tuple<(A, B, C)>, (<A as ValueSpec>::Tensors, <B as ValueSpec>::Tensors, <C as ValueSpec>::Tensors), (<A as ValueSpec>::Gradient, <B as ValueSpec>::Gradient, <C as ValueSpec>::Gradient)> for (A, B, C)
where A: Value, B: Value, C: Value, (A::Tensors, B::Tensors, C::Tensors): TensorIter,

source§

fn gv_tensors(&self) -> (A::Tensors, B::Tensors, C::Tensors)

source§

fn gv_grad( tensors: &(A::Tensors, B::Tensors, C::Tensors), grad_map: &HashMap<usize, Tensor> ) -> (A::Gradient, B::Gradient, C::Gradient)

source§

fn gv_grad_map( tensors: &(A::Tensors, B::Tensors, C::Tensors), grad: (A::Gradient, B::Gradient, C::Gradient), out: &mut HashMap<usize, Tensor> )

source§

impl<A, B, C, D> GenericValue<Tuple<(A, B, C, D)>, (<A as ValueSpec>::Tensors, <B as ValueSpec>::Tensors, <C as ValueSpec>::Tensors, <D as ValueSpec>::Tensors), (<A as ValueSpec>::Gradient, <B as ValueSpec>::Gradient, <C as ValueSpec>::Gradient, <D as ValueSpec>::Gradient)> for (A, B, C, D)
where A: Value, B: Value, C: Value, D: Value, (A::Tensors, B::Tensors, C::Tensors, D::Tensors): TensorIter,

source§

fn gv_tensors(&self) -> (A::Tensors, B::Tensors, C::Tensors, D::Tensors)

source§

fn gv_grad( tensors: &(A::Tensors, B::Tensors, C::Tensors, D::Tensors), grad_map: &HashMap<usize, Tensor> ) -> (A::Gradient, B::Gradient, C::Gradient, D::Gradient)

source§

fn gv_grad_map( tensors: &(A::Tensors, B::Tensors, C::Tensors, D::Tensors), grad: (A::Gradient, B::Gradient, C::Gradient, D::Gradient), out: &mut HashMap<usize, Tensor> )

source§

impl<A, B, C, D, E> GenericValue<Tuple<(A, B, C, D, E)>, (<A as ValueSpec>::Tensors, <B as ValueSpec>::Tensors, <C as ValueSpec>::Tensors, <D as ValueSpec>::Tensors, <E as ValueSpec>::Tensors), (<A as ValueSpec>::Gradient, <B as ValueSpec>::Gradient, <C as ValueSpec>::Gradient, <D as ValueSpec>::Gradient, <E as ValueSpec>::Gradient)> for (A, B, C, D, E)
where A: Value, B: Value, C: Value, D: Value, E: Value, (A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors): TensorIter,

source§

fn gv_tensors( &self ) -> (A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors)

source§

fn gv_grad( tensors: &(A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors), grad_map: &HashMap<usize, Tensor> ) -> (A::Gradient, B::Gradient, C::Gradient, D::Gradient, E::Gradient)

source§

fn gv_grad_map( tensors: &(A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors), grad: (A::Gradient, B::Gradient, C::Gradient, D::Gradient, E::Gradient), out: &mut HashMap<usize, Tensor> )

source§

impl<A, B, C, D, E, F> GenericValue<Tuple<(A, B, C, D, E, F)>, (<A as ValueSpec>::Tensors, <B as ValueSpec>::Tensors, <C as ValueSpec>::Tensors, <D as ValueSpec>::Tensors, <E as ValueSpec>::Tensors, <F as ValueSpec>::Tensors), (<A as ValueSpec>::Gradient, <B as ValueSpec>::Gradient, <C as ValueSpec>::Gradient, <D as ValueSpec>::Gradient, <E as ValueSpec>::Gradient, <F as ValueSpec>::Gradient)> for (A, B, C, D, E, F)
where A: Value, B: Value, C: Value, D: Value, E: Value, F: Value, (A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors): TensorIter,

source§

fn gv_tensors( &self ) -> (A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors)

source§

fn gv_grad( tensors: &(A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors), grad_map: &HashMap<usize, Tensor> ) -> (A::Gradient, B::Gradient, C::Gradient, D::Gradient, E::Gradient, F::Gradient)

source§

fn gv_grad_map( tensors: &(A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors), grad: (A::Gradient, B::Gradient, C::Gradient, D::Gradient, E::Gradient, F::Gradient), out: &mut HashMap<usize, Tensor> )

source§

impl<A, B, C, D, E, F, G> GenericValue<Tuple<(A, B, C, D, E, F, G)>, (<A as ValueSpec>::Tensors, <B as ValueSpec>::Tensors, <C as ValueSpec>::Tensors, <D as ValueSpec>::Tensors, <E as ValueSpec>::Tensors, <F as ValueSpec>::Tensors, <G as ValueSpec>::Tensors), (<A as ValueSpec>::Gradient, <B as ValueSpec>::Gradient, <C as ValueSpec>::Gradient, <D as ValueSpec>::Gradient, <E as ValueSpec>::Gradient, <F as ValueSpec>::Gradient, <G as ValueSpec>::Gradient)> for (A, B, C, D, E, F, G)
where A: Value, B: Value, C: Value, D: Value, E: Value, F: Value, G: Value, (A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors): TensorIter,

source§

fn gv_tensors( &self ) -> (A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors)

source§

fn gv_grad( tensors: &(A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors), grad_map: &HashMap<usize, Tensor> ) -> (A::Gradient, B::Gradient, C::Gradient, D::Gradient, E::Gradient, F::Gradient, G::Gradient)

source§

fn gv_grad_map( tensors: &(A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors), grad: (A::Gradient, B::Gradient, C::Gradient, D::Gradient, E::Gradient, F::Gradient, G::Gradient), out: &mut HashMap<usize, Tensor> )

source§

impl<A, B, C, D, E, F, G, H> GenericValue<Tuple<(A, B, C, D, E, F, G, H)>, (<A as ValueSpec>::Tensors, <B as ValueSpec>::Tensors, <C as ValueSpec>::Tensors, <D as ValueSpec>::Tensors, <E as ValueSpec>::Tensors, <F as ValueSpec>::Tensors, <G as ValueSpec>::Tensors, <H as ValueSpec>::Tensors), (<A as ValueSpec>::Gradient, <B as ValueSpec>::Gradient, <C as ValueSpec>::Gradient, <D as ValueSpec>::Gradient, <E as ValueSpec>::Gradient, <F as ValueSpec>::Gradient, <G as ValueSpec>::Gradient, <H as ValueSpec>::Gradient)> for (A, B, C, D, E, F, G, H)
where A: Value, B: Value, C: Value, D: Value, E: Value, F: Value, G: Value, H: Value, (A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors, H::Tensors): TensorIter,

source§

fn gv_tensors( &self ) -> (A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors, H::Tensors)

source§

fn gv_grad( tensors: &(A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors, H::Tensors), grad_map: &HashMap<usize, Tensor> ) -> (A::Gradient, B::Gradient, C::Gradient, D::Gradient, E::Gradient, F::Gradient, G::Gradient, H::Gradient)

source§

fn gv_grad_map( tensors: &(A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors, H::Tensors), grad: (A::Gradient, B::Gradient, C::Gradient, D::Gradient, E::Gradient, F::Gradient, G::Gradient, H::Gradient), out: &mut HashMap<usize, Tensor> )

source§

impl<A, B, C, D, E, F, G, H, I> GenericValue<Tuple<(A, B, C, D, E, F, G, H, I)>, (<A as ValueSpec>::Tensors, <B as ValueSpec>::Tensors, <C as ValueSpec>::Tensors, <D as ValueSpec>::Tensors, <E as ValueSpec>::Tensors, <F as ValueSpec>::Tensors, <G as ValueSpec>::Tensors, <H as ValueSpec>::Tensors, <I as ValueSpec>::Tensors), (<A as ValueSpec>::Gradient, <B as ValueSpec>::Gradient, <C as ValueSpec>::Gradient, <D as ValueSpec>::Gradient, <E as ValueSpec>::Gradient, <F as ValueSpec>::Gradient, <G as ValueSpec>::Gradient, <H as ValueSpec>::Gradient, <I as ValueSpec>::Gradient)> for (A, B, C, D, E, F, G, H, I)
where A: Value, B: Value, C: Value, D: Value, E: Value, F: Value, G: Value, H: Value, I: Value, (A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors, H::Tensors, I::Tensors): TensorIter,

source§

fn gv_tensors( &self ) -> (A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors, H::Tensors, I::Tensors)

source§

fn gv_grad( tensors: &(A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors, H::Tensors, I::Tensors), grad_map: &HashMap<usize, Tensor> ) -> (A::Gradient, B::Gradient, C::Gradient, D::Gradient, E::Gradient, F::Gradient, G::Gradient, H::Gradient, I::Gradient)

source§

fn gv_grad_map( tensors: &(A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors, H::Tensors, I::Tensors), grad: (A::Gradient, B::Gradient, C::Gradient, D::Gradient, E::Gradient, F::Gradient, G::Gradient, H::Gradient, I::Gradient), out: &mut HashMap<usize, Tensor> )

source§

impl<A, B, C, D, E, F, G, H, I, J> GenericValue<Tuple<(A, B, C, D, E, F, G, H, I, J)>, (<A as ValueSpec>::Tensors, <B as ValueSpec>::Tensors, <C as ValueSpec>::Tensors, <D as ValueSpec>::Tensors, <E as ValueSpec>::Tensors, <F as ValueSpec>::Tensors, <G as ValueSpec>::Tensors, <H as ValueSpec>::Tensors, <I as ValueSpec>::Tensors, <J as ValueSpec>::Tensors), (<A as ValueSpec>::Gradient, <B as ValueSpec>::Gradient, <C as ValueSpec>::Gradient, <D as ValueSpec>::Gradient, <E as ValueSpec>::Gradient, <F as ValueSpec>::Gradient, <G as ValueSpec>::Gradient, <H as ValueSpec>::Gradient, <I as ValueSpec>::Gradient, <J as ValueSpec>::Gradient)> for (A, B, C, D, E, F, G, H, I, J)
where A: Value, B: Value, C: Value, D: Value, E: Value, F: Value, G: Value, H: Value, I: Value, J: Value, (A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors, H::Tensors, I::Tensors, J::Tensors): TensorIter,

source§

fn gv_tensors( &self ) -> (A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors, H::Tensors, I::Tensors, J::Tensors)

source§

fn gv_grad( tensors: &(A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors, H::Tensors, I::Tensors, J::Tensors), grad_map: &HashMap<usize, Tensor> ) -> (A::Gradient, B::Gradient, C::Gradient, D::Gradient, E::Gradient, F::Gradient, G::Gradient, H::Gradient, I::Gradient, J::Gradient)

source§

fn gv_grad_map( tensors: &(A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors, H::Tensors, I::Tensors, J::Tensors), grad: (A::Gradient, B::Gradient, C::Gradient, D::Gradient, E::Gradient, F::Gradient, G::Gradient, H::Gradient, I::Gradient, J::Gradient), out: &mut HashMap<usize, Tensor> )

source§

impl<A, B, C, D, E, F, G, H, I, J, K> GenericValue<Tuple<(A, B, C, D, E, F, G, H, I, J, K)>, (<A as ValueSpec>::Tensors, <B as ValueSpec>::Tensors, <C as ValueSpec>::Tensors, <D as ValueSpec>::Tensors, <E as ValueSpec>::Tensors, <F as ValueSpec>::Tensors, <G as ValueSpec>::Tensors, <H as ValueSpec>::Tensors, <I as ValueSpec>::Tensors, <J as ValueSpec>::Tensors, <K as ValueSpec>::Tensors), (<A as ValueSpec>::Gradient, <B as ValueSpec>::Gradient, <C as ValueSpec>::Gradient, <D as ValueSpec>::Gradient, <E as ValueSpec>::Gradient, <F as ValueSpec>::Gradient, <G as ValueSpec>::Gradient, <H as ValueSpec>::Gradient, <I as ValueSpec>::Gradient, <J as ValueSpec>::Gradient, <K as ValueSpec>::Gradient)> for (A, B, C, D, E, F, G, H, I, J, K)
where A: Value, B: Value, C: Value, D: Value, E: Value, F: Value, G: Value, H: Value, I: Value, J: Value, K: Value, (A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors, H::Tensors, I::Tensors, J::Tensors, K::Tensors): TensorIter,

source§

fn gv_tensors( &self ) -> (A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors, H::Tensors, I::Tensors, J::Tensors, K::Tensors)

source§

fn gv_grad( tensors: &(A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors, H::Tensors, I::Tensors, J::Tensors, K::Tensors), grad_map: &HashMap<usize, Tensor> ) -> (A::Gradient, B::Gradient, C::Gradient, D::Gradient, E::Gradient, F::Gradient, G::Gradient, H::Gradient, I::Gradient, J::Gradient, K::Gradient)

source§

fn gv_grad_map( tensors: &(A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors, H::Tensors, I::Tensors, J::Tensors, K::Tensors), grad: (A::Gradient, B::Gradient, C::Gradient, D::Gradient, E::Gradient, F::Gradient, G::Gradient, H::Gradient, I::Gradient, J::Gradient, K::Gradient), out: &mut HashMap<usize, Tensor> )

source§

impl<A, B, C, D, E, F, G, H, I, J, K, L> GenericValue<Tuple<(A, B, C, D, E, F, G, H, I, J, K, L)>, (<A as ValueSpec>::Tensors, <B as ValueSpec>::Tensors, <C as ValueSpec>::Tensors, <D as ValueSpec>::Tensors, <E as ValueSpec>::Tensors, <F as ValueSpec>::Tensors, <G as ValueSpec>::Tensors, <H as ValueSpec>::Tensors, <I as ValueSpec>::Tensors, <J as ValueSpec>::Tensors, <K as ValueSpec>::Tensors, <L as ValueSpec>::Tensors), (<A as ValueSpec>::Gradient, <B as ValueSpec>::Gradient, <C as ValueSpec>::Gradient, <D as ValueSpec>::Gradient, <E as ValueSpec>::Gradient, <F as ValueSpec>::Gradient, <G as ValueSpec>::Gradient, <H as ValueSpec>::Gradient, <I as ValueSpec>::Gradient, <J as ValueSpec>::Gradient, <K as ValueSpec>::Gradient, <L as ValueSpec>::Gradient)> for (A, B, C, D, E, F, G, H, I, J, K, L)
where A: Value, B: Value, C: Value, D: Value, E: Value, F: Value, G: Value, H: Value, I: Value, J: Value, K: Value, L: Value, (A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors, H::Tensors, I::Tensors, J::Tensors, K::Tensors, L::Tensors): TensorIter,

source§

fn gv_tensors( &self ) -> (A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors, H::Tensors, I::Tensors, J::Tensors, K::Tensors, L::Tensors)

source§

fn gv_grad( tensors: &(A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors, H::Tensors, I::Tensors, J::Tensors, K::Tensors, L::Tensors), grad_map: &HashMap<usize, Tensor> ) -> (A::Gradient, B::Gradient, C::Gradient, D::Gradient, E::Gradient, F::Gradient, G::Gradient, H::Gradient, I::Gradient, J::Gradient, K::Gradient, L::Gradient)

source§

fn gv_grad_map( tensors: &(A::Tensors, B::Tensors, C::Tensors, D::Tensors, E::Tensors, F::Tensors, G::Tensors, H::Tensors, I::Tensors, J::Tensors, K::Tensors, L::Tensors), grad: (A::Gradient, B::Gradient, C::Gradient, D::Gradient, E::Gradient, F::Gradient, G::Gradient, H::Gradient, I::Gradient, J::Gradient, K::Gradient, L::Gradient), out: &mut HashMap<usize, Tensor> )

source§

impl<E> GenericValue<Basic, (), ()> for Result<bool, E>

source§

impl<E> GenericValue<Basic, (), ()> for Result<f32, E>

source§

impl<E> GenericValue<Basic, (), ()> for Result<f64, E>

source§

impl<E> GenericValue<Basic, (), ()> for Result<i8, E>

source§

impl<E> GenericValue<Basic, (), ()> for Result<i16, E>

source§

impl<E> GenericValue<Basic, (), ()> for Result<i32, E>

source§

impl<E> GenericValue<Basic, (), ()> for Result<i64, E>

source§

impl<E> GenericValue<Basic, (), ()> for Result<i128, E>

source§

impl<E> GenericValue<Basic, (), ()> for Result<isize, E>

source§

impl<E> GenericValue<Basic, (), ()> for Result<u8, E>

source§

impl<E> GenericValue<Basic, (), ()> for Result<u16, E>

source§

impl<E> GenericValue<Basic, (), ()> for Result<u32, E>

source§

impl<E> GenericValue<Basic, (), ()> for Result<u64, E>

source§

impl<E> GenericValue<Basic, (), ()> for Result<u128, E>

source§

impl<E> GenericValue<Basic, (), ()> for Result<(), E>

source§

impl<E> GenericValue<Basic, (), ()> for Result<usize, E>

source§

impl<E> GenericValue<Basic, (), ()> for Result<bf16, E>

source§

impl<E> GenericValue<Basic, (), ()> for Result<f16, E>

source§

impl<const N: usize, T> GenericValue<Array<[T; N]>, [<T as ValueSpec>::Tensors; N], [<T as ValueSpec>::Gradient; N]> for [T; N]
where T: Value, [T::Tensors; N]: TensorIter,

source§

fn gv_tensors(&self) -> [T::Tensors; N]

source§

fn gv_grad( tensors: &[T::Tensors; N], grad_map: &HashMap<usize, Tensor> ) -> [T::Gradient; N]

source§

fn gv_grad_map( tensors: &[T::Tensors; N], grad: [T::Gradient; N], out: &mut HashMap<usize, Tensor> )

Implementors§

source§

impl GenericValue<Basic, Tensor, Tensor> for Tensor

source§

impl<T> GenericValue<Basic, (), ()> for Aux<T>

source§

impl<T> GenericValue<Module, (), ()> for T
where T: NonTrainableModule<Tensors = (), Gradient = ()>,

source§

impl<T> GenericValue<Module, HashMap<usize, Tensor>, HashMap<usize, Tensor>> for T
where T: TrainableModule<Tensors = HashMap<usize, Tensor>, Gradient = HashMap<usize, Tensor>>,