TensorScalarContextFor

Trait TensorScalarContextFor 

Source
pub trait TensorScalarContextFor<Alg: Algebra> {
    type ScalarBackend: TensorScalarPrims<Alg, Context = Self>;
}
Expand description

Bridge trait that binds a scalar-family execution context to its backend.

High-level crates use this trait to stay generic over runtime context types while dispatching pointwise and reduction scalar families through the correct backend marker type.

§Examples

use tenferro_algebra::Standard;
use tenferro_prims::{CpuContext, TensorScalarContextFor};

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

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

Required Associated Types§

Source

type ScalarBackend: TensorScalarPrims<Alg, Context = Self>

Backend associated with this context for the scalar family.

Implementors§