tenferro_linalg_prims/backend/
context.rs

1use tenferro_algebra::Standard;
2use tenferro_prims::TensorSemiringContextFor;
3
4use crate::{KernelLinalgScalar, TensorLinalgPrims};
5
6/// Maps a context type to its tensor-level linalg backend.
7///
8/// # Examples
9///
10/// ```ignore
11/// use tenferro_linalg_prims::backend::TensorLinalgContextFor;
12///
13/// fn accepts_ctx<T, C>(_ctx: &mut C)
14/// where
15///     T: tenferro_linalg_prims::KernelLinalgScalar,
16///     C: TensorLinalgContextFor<T>,
17/// {
18/// }
19/// ```
20pub trait TensorLinalgContextFor<T: KernelLinalgScalar>:
21    TensorSemiringContextFor<Standard<T>>
22{
23    /// The backend associated with this context type.
24    type Backend: TensorLinalgPrims<T, Context = Self>;
25}