pub trait Primitive: Debug + DynClone {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn jvp(
        &self,
        output: &Tensor,
        primals: &[Tensor],
        tangents: &[Tensor]
    ) -> Tensor;
    fn vjp(
        &self,
        output: &Tensor,
        primals: &[Tensor],
        cotangent: &Tensor
    ) -> Vec<Tensor>;

    // Provided method
    fn dot_label(&self) -> String { ... }
}

Required Methods§

source

fn as_any(&self) -> &dyn Any

source

fn jvp( &self, output: &Tensor, primals: &[Tensor], tangents: &[Tensor] ) -> Tensor

source

fn vjp( &self, output: &Tensor, primals: &[Tensor], cotangent: &Tensor ) -> Vec<Tensor>

Provided Methods§

source

fn dot_label(&self) -> String

Trait Implementations§

source§

impl<B, P> Eval<dyn Backend, dyn Primitive> for Dispatch<B, P>
where B: Backend + 'static + Sync + Send, P: Primitive + 'static + Sync + Send, Self: Eval<B, P> + 'static,

source§

fn eval( &self, backend: &dyn Backend, primitive: &dyn Primitive, inputs: &[Tensor], output: &Tensor )

source§

impl From<&Box<dyn Primitive>> for Box<dyn Primitive>

source§

fn from(value: &Box<dyn Primitive>) -> Self

Converts to this type from the input type.
source§

impl<T> From<T> for Box<dyn Primitive>
where T: Primitive + 'static,

source§

fn from(t: T) -> Self

Converts to this type from the input type.

Implementors§