Struct rai_core::BasicValue

source ·
pub struct BasicValue;

Trait Implementations§

source§

impl<A> GenericValue<BasicValue, <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<const N: usize, T> GenericValue<BasicValue, [<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> )

source§

impl<A, B> GenericValue<BasicValue, (<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<BasicValue, (<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<BasicValue, (<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<BasicValue, (<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<BasicValue, (<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<BasicValue, (<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<BasicValue, (<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<BasicValue, (<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<BasicValue, (<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<BasicValue, (<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<BasicValue, (<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<T> GenericValue<BasicValue, (), ()> for Aux<T>

source§

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

source§

impl<'a, T, G, X> GenericValue<BasicValue, T, G> for &'a X
where X: GenericValue<BasicValue, 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 GenericValue<BasicValue, Tensor, Tensor> for Tensor

source§

fn gv_tensors(&self) -> Tensor

source§

fn gv_grad(tensor: &Tensor, grad_map: &HashMap<usize, Tensor>) -> Tensor

source§

fn gv_grad_map(tensor: &Tensor, grad: Tensor, out: &mut HashMap<usize, Tensor>)

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,