pub enum TropicalPlan<T: ScalarBase> {
BatchedGemm {
m: usize,
n: usize,
k: usize,
_marker: PhantomData<T>,
},
Reduce {
axis: usize,
op: ReduceOp,
_marker: PhantomData<T>,
},
Trace {
paired: Vec<(u32, u32)>,
_marker: PhantomData<T>,
},
Permute {
perm: Vec<usize>,
_marker: PhantomData<T>,
},
AntiTrace {
paired: Vec<(u32, u32)>,
_marker: PhantomData<T>,
},
AntiDiag {
paired: Vec<(u32, u32)>,
_marker: PhantomData<T>,
},
}Expand description
Execution plan for tropical primitive operations on CPU.
Analogous to CpuPlan but for tropical
algebras. The plan captures pre-computed kernel selection information.
§Examples
ⓘ
use tenferro_prims::{CpuBackend, TensorPrims, PrimDescriptor, ReduceOp};
use tenferro_tropical::{MaxPlusAlgebra, TropicalPlan};
let desc = PrimDescriptor::Reduce {
modes_a: vec![0, 1],
modes_c: vec![0],
op: ReduceOp::Max,
};
let plan: TropicalPlan<f64> = CpuBackend::plan::<f64>(&desc, &[&[3, 4], &[3]]).unwrap();Variants§
BatchedGemm
Plan for batched GEMM under tropical algebra.
Fields
§
_marker: PhantomData<T>Reduce
Plan for reduction under tropical algebra.
Trace
Plan for trace under tropical algebra.
Permute
Plan for permutation.
AntiTrace
Plan for anti-trace (AD backward).
AntiDiag
Plan for anti-diag (AD backward).
Auto Trait Implementations§
impl<T> Freeze for TropicalPlan<T>
impl<T> RefUnwindSafe for TropicalPlan<T>where
T: RefUnwindSafe,
impl<T> Send for TropicalPlan<T>
impl<T> Sync for TropicalPlan<T>
impl<T> Unpin for TropicalPlan<T>where
T: Unpin,
impl<T> UnwindSafe for TropicalPlan<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more