LinearizableOp

Trait LinearizableOp 

pub trait LinearizableOp<V>:
    Send
    + Sync
    + 'static
where V: Differentiable + Send + Sync + 'static,
{ type Linearized: LinearizedOp<V> + Send + Sync + 'static; // Required methods fn primal(&self, inputs: &[&V]) -> Result<Vec<V>, AutodiffError>; fn input_schema(&self, inputs: &[&V]) -> Result<Schema, AutodiffError>; fn output_schema( &self, inputs: &[&V], outputs: &[V], ) -> Result<Schema, AutodiffError>; fn linearize( &self, inputs: &[&V], outputs: &[V], ) -> Result<Self::Linearized, AutodiffError>; // Provided methods fn checkpoint_hint(&self) -> CheckpointHint { ... } fn apply( &self, inputs: &[&Value<V>], ) -> Result<Vec<Value<V>>, AutodiffError> where Self: Sized + Clone { ... } fn apply_one(&self, inputs: &[&Value<V>]) -> Result<Value<V>, AutodiffError> where Self: Sized + Clone { ... } }

Required Associated Types§

type Linearized: LinearizedOp<V> + Send + Sync + 'static

Required Methods§

fn primal(&self, inputs: &[&V]) -> Result<Vec<V>, AutodiffError>

fn input_schema(&self, inputs: &[&V]) -> Result<Schema, AutodiffError>

fn output_schema( &self, inputs: &[&V], outputs: &[V], ) -> Result<Schema, AutodiffError>

fn linearize( &self, inputs: &[&V], outputs: &[V], ) -> Result<Self::Linearized, AutodiffError>

Provided Methods§

fn checkpoint_hint(&self) -> CheckpointHint

Return a retain-vs-replay hint for the runtime checkpoint policy.

fn apply(&self, inputs: &[&Value<V>]) -> Result<Vec<Value<V>>, AutodiffError>
where Self: Sized + Clone,

fn apply_one(&self, inputs: &[&Value<V>]) -> Result<Value<V>, AutodiffError>
where Self: Sized + Clone,

Implementors§