pub enum GraphOpView<'a> {
Show 24 variants
Constant {
dtype: DType,
bytes: &'a [u8],
},
Add,
Multiply,
Negate,
Divide,
Abs,
Exp,
Log,
Sin,
Cos,
Tanh,
Sqrt,
Rsqrt,
Pow,
Expm1,
Log1p,
Convert {
to: DType,
},
Reshape,
BroadcastInDim {
dims: &'a [usize],
},
Transpose {
perm: &'a [usize],
},
ReduceSum {
axes: &'a [usize],
},
DotGeneral {
config: &'a DotGeneralConfig,
},
Extension {
op: &'a dyn ExtensionOp,
},
Unsupported {
name: &'static str,
},
}Expand description
Read-only operation view for graph lowering integrations.
Unsupported operation families are represented as GraphOpView::Unsupported
so peer executors can emit precise diagnostics without depending on the raw
execution IR.
§Examples
use tenferro_runtime::{GraphCompiler, GraphOpView, TracedTensor};
let x = TracedTensor::from_vec_col_major(vec![1], vec![2.0_f64]).unwrap();
let mut compiler = GraphCompiler::new();
let program = compiler.compile(&x.neg()).unwrap();
let op = program.lowering_view().instructions().next().unwrap().op();
assert!(matches!(op, GraphOpView::Negate));Variants§
Constant
Scalar constant payload.
Add
Elementwise addition.
Multiply
Elementwise multiplication.
Negate
Elementwise negation.
Divide
Elementwise division.
Abs
Elementwise absolute value.
Exp
Elementwise exponential.
Log
Elementwise natural logarithm.
Sin
Elementwise sine.
Cos
Elementwise cosine.
Tanh
Elementwise hyperbolic tangent.
Sqrt
Elementwise square root.
Rsqrt
Elementwise reciprocal square root.
Pow
Elementwise power.
Expm1
Elementwise exponential minus one.
Log1p
Elementwise natural logarithm of one plus input.
Convert
Dtype conversion.
Reshape
Shape-only reshape.
BroadcastInDim
Broadcast with output-to-input dimension mapping.
Transpose
Transpose with output dimension permutation.
ReduceSum
Sum reduction.
DotGeneral
General dot/contraction.
Fields
config: &'a DotGeneralConfigExtension
Extension operation with an owner-provided optional standard-op lowering.
Fields
op: &'a dyn ExtensionOpUnsupported
Operation outside the stable public lowering view.
Implementations§
Source§impl GraphOpView<'_>
impl GraphOpView<'_>
Sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
Return the stable operation name used in diagnostics.
§Examples
use tenferro_runtime::{GraphCompiler, TracedTensor};
let x = TracedTensor::from_vec_col_major(vec![1], vec![2.0_f64]).unwrap();
let mut compiler = GraphCompiler::new();
let program = compiler.compile(&x.neg()).unwrap();
let op = program.lowering_view().instructions().next().unwrap().op();
assert_eq!(op.name(), "Negate");Trait Implementations§
Source§impl<'a> Clone for GraphOpView<'a>
impl<'a> Clone for GraphOpView<'a>
Source§fn clone(&self) -> GraphOpView<'a>
fn clone(&self) -> GraphOpView<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more