pub struct CompilationTrace {
pub input_expr: String,
pub steps: Vec<CompilationStep>,
pub final_graph: Option<String>,
pub errors: Vec<String>,
pub duration_ms: Option<f64>,
}Expand description
Compilation trace for debugging.
Captures the state of compilation at each major step, allowing developers to understand how expressions are transformed into tensor graphs.
Fields§
§input_expr: StringOriginal expression before compilation
steps: Vec<CompilationStep>Compilation steps with intermediate states
final_graph: Option<String>Final compiled graph (if successful)
errors: Vec<String>Errors encountered during compilation
duration_ms: Option<f64>Total compilation time (if measured)
Implementations§
Source§impl CompilationTrace
impl CompilationTrace
Sourcepub fn add_step(
&mut self,
phase: impl Into<String>,
description: impl Into<String>,
ctx: &CompilerContext,
graph: &EinsumGraph,
)
pub fn add_step( &mut self, phase: impl Into<String>, description: impl Into<String>, ctx: &CompilerContext, graph: &EinsumGraph, )
Add a compilation step to the trace.
Sourcepub fn set_final_graph(&mut self, graph: &EinsumGraph)
pub fn set_final_graph(&mut self, graph: &EinsumGraph)
Set the final compiled graph.
Sourcepub fn set_duration(&mut self, duration_ms: f64)
pub fn set_duration(&mut self, duration_ms: f64)
Set the total compilation duration.
Sourcepub fn print_summary(&self)
pub fn print_summary(&self)
Print a summary of the compilation trace.
Sourcepub fn detailed_report(&self) -> String
pub fn detailed_report(&self) -> String
Generate a detailed report with all intermediate states.
Trait Implementations§
Source§impl Clone for CompilationTrace
impl Clone for CompilationTrace
Source§fn clone(&self) -> CompilationTrace
fn clone(&self) -> CompilationTrace
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CompilationTrace
impl RefUnwindSafe for CompilationTrace
impl Send for CompilationTrace
impl Sync for CompilationTrace
impl Unpin for CompilationTrace
impl UnwindSafe for CompilationTrace
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