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,

Implementations on Foreign Types§

§

impl LinearizableOp<DynTensor> for AddOp

§

type Linearized = AddLinearized

§

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

§

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

§

fn output_schema( &self, _inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<Schema, AutodiffError>

§

fn linearize( &self, _inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<<AddOp as LinearizableOp<DynTensor>>::Linearized, AutodiffError>

§

fn checkpoint_hint(&self) -> CheckpointHint

§

impl LinearizableOp<DynTensor> for CholeskyOp

§

type Linearized = CholeskyLinearized

§

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

§

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

§

fn output_schema( &self, _inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<Schema, AutodiffError>

§

fn linearize( &self, inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<<CholeskyOp as LinearizableOp<DynTensor>>::Linearized, AutodiffError>

§

fn checkpoint_hint(&self) -> CheckpointHint

§

impl LinearizableOp<DynTensor> for DetOp

§

type Linearized = DetLinearized

§

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

§

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

§

fn output_schema( &self, _inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<Schema, AutodiffError>

§

fn linearize( &self, inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<<DetOp as LinearizableOp<DynTensor>>::Linearized, AutodiffError>

§

fn checkpoint_hint(&self) -> CheckpointHint

§

impl LinearizableOp<DynTensor> for EigOp

§

type Linearized = EigLinearized

§

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

§

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

§

fn output_schema( &self, _inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<Schema, AutodiffError>

§

fn linearize( &self, inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<<EigOp as LinearizableOp<DynTensor>>::Linearized, AutodiffError>

§

fn checkpoint_hint(&self) -> CheckpointHint

§

impl LinearizableOp<DynTensor> for EigenOp

§

type Linearized = EigenLinearized

§

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

§

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

§

fn output_schema( &self, _inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<Schema, AutodiffError>

§

fn linearize( &self, inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<<EigenOp as LinearizableOp<DynTensor>>::Linearized, AutodiffError>

§

fn checkpoint_hint(&self) -> CheckpointHint

§

impl LinearizableOp<DynTensor> for EinsumOp

§

type Linearized = EinsumLinearized

§

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

§

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

§

fn output_schema( &self, _inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<Schema, AutodiffError>

§

fn linearize( &self, inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<<EinsumOp as LinearizableOp<DynTensor>>::Linearized, AutodiffError>

§

fn checkpoint_hint(&self) -> CheckpointHint

§

impl LinearizableOp<DynTensor> for ExpOp

§

type Linearized = ExpLinearized

§

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

§

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

§

fn output_schema( &self, _inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<Schema, AutodiffError>

§

fn linearize( &self, _inputs: &[&DynTensor], outputs: &[DynTensor], ) -> Result<<ExpOp as LinearizableOp<DynTensor>>::Linearized, AutodiffError>

§

fn checkpoint_hint(&self) -> CheckpointHint

§

impl LinearizableOp<DynTensor> for InvOp

§

type Linearized = InvLinearized

§

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

§

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

§

fn output_schema( &self, _inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<Schema, AutodiffError>

§

fn linearize( &self, inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<<InvOp as LinearizableOp<DynTensor>>::Linearized, AutodiffError>

§

fn checkpoint_hint(&self) -> CheckpointHint

§

impl LinearizableOp<DynTensor> for LstsqOp

§

type Linearized = LstsqLinearized

§

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

§

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

§

fn output_schema( &self, _inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<Schema, AutodiffError>

§

fn linearize( &self, inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<<LstsqOp as LinearizableOp<DynTensor>>::Linearized, AutodiffError>

§

fn checkpoint_hint(&self) -> CheckpointHint

§

impl LinearizableOp<DynTensor> for LuOp

§

type Linearized = LuLinearized

§

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

§

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

§

fn output_schema( &self, _inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<Schema, AutodiffError>

§

fn linearize( &self, inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<<LuOp as LinearizableOp<DynTensor>>::Linearized, AutodiffError>

§

fn checkpoint_hint(&self) -> CheckpointHint

§

impl LinearizableOp<DynTensor> for MatrixExpOp

§

type Linearized = MatrixExpLinearized

§

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

§

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

§

fn output_schema( &self, _inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<Schema, AutodiffError>

§

fn linearize( &self, inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<<MatrixExpOp as LinearizableOp<DynTensor>>::Linearized, AutodiffError>

§

fn checkpoint_hint(&self) -> CheckpointHint

§

impl LinearizableOp<DynTensor> for NormOp

§

type Linearized = NormLinearized

§

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

§

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

§

fn output_schema( &self, _inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<Schema, AutodiffError>

§

fn linearize( &self, inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<<NormOp as LinearizableOp<DynTensor>>::Linearized, AutodiffError>

§

fn checkpoint_hint(&self) -> CheckpointHint

§

impl LinearizableOp<DynTensor> for PInvOp

§

type Linearized = PInvLinearized

§

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

§

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

§

fn output_schema( &self, _inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<Schema, AutodiffError>

§

fn linearize( &self, inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<<PInvOp as LinearizableOp<DynTensor>>::Linearized, AutodiffError>

§

fn checkpoint_hint(&self) -> CheckpointHint

§

impl LinearizableOp<DynTensor> for QrOp

§

type Linearized = QrLinearized

§

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

§

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

§

fn output_schema( &self, _inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<Schema, AutodiffError>

§

fn linearize( &self, inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<<QrOp as LinearizableOp<DynTensor>>::Linearized, AutodiffError>

§

fn checkpoint_hint(&self) -> CheckpointHint

§

impl LinearizableOp<DynTensor> for SlogdetOp

§

type Linearized = SlogdetLinearized

§

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

§

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

§

fn output_schema( &self, _inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<Schema, AutodiffError>

§

fn linearize( &self, inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<<SlogdetOp as LinearizableOp<DynTensor>>::Linearized, AutodiffError>

§

fn checkpoint_hint(&self) -> CheckpointHint

§

impl LinearizableOp<DynTensor> for SolveOp

§

type Linearized = SolveLinearized

§

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

§

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

§

fn output_schema( &self, _inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<Schema, AutodiffError>

§

fn linearize( &self, inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<<SolveOp as LinearizableOp<DynTensor>>::Linearized, AutodiffError>

§

fn checkpoint_hint(&self) -> CheckpointHint

§

impl LinearizableOp<DynTensor> for SolveTriangularOp

§

type Linearized = SolveTriangularLinearized

§

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

§

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

§

fn output_schema( &self, _inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<Schema, AutodiffError>

§

fn linearize( &self, inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<<SolveTriangularOp as LinearizableOp<DynTensor>>::Linearized, AutodiffError>

§

fn checkpoint_hint(&self) -> CheckpointHint

§

impl LinearizableOp<DynTensor> for SumOp

§

type Linearized = SumLinearized

§

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

§

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

§

fn output_schema( &self, _inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<Schema, AutodiffError>

§

fn linearize( &self, inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<<SumOp as LinearizableOp<DynTensor>>::Linearized, AutodiffError>

§

fn checkpoint_hint(&self) -> CheckpointHint

§

impl LinearizableOp<DynTensor> for SvdOp

§

type Linearized = SvdLinearized

§

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

§

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

§

fn output_schema( &self, _inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<Schema, AutodiffError>

§

fn linearize( &self, inputs: &[&DynTensor], _outputs: &[DynTensor], ) -> Result<<SvdOp as LinearizableOp<DynTensor>>::Linearized, AutodiffError>

§

fn checkpoint_hint(&self) -> CheckpointHint

Implementors§