TensorSemiringContextFor

Trait TensorSemiringContextFor 

Source
pub trait TensorSemiringContextFor<Alg: Semiring> {
    type SemiringBackend: TensorSemiringCore<Alg, Context = Self>;
}
Expand description

Bridge trait that binds a semiring execution context to its backend.

High-level crates use this trait to stay generic over runtime context types while still dispatching semiring execution through the correct backend marker type.

§Examples

use tenferro_prims::{CpuContext, TensorSemiringContextFor};

fn accepts_context<C>(_: &mut C)
where
    C: TensorSemiringContextFor<tenferro_algebra::Standard<f64>>,
{
}

let mut ctx = CpuContext::new(1);
accepts_context(&mut ctx);

Required Associated Types§

Source

type SemiringBackend: TensorSemiringCore<Alg, Context = Self>

Backend associated with this context for the given algebra family.

Implementors§