candle_graph/lib.rs
1//! Static structure and dataflow analysis for candle-rs models.
2//!
3//! See `README.md` for the motivation. In short: candle's autograd graph is not inspectable at
4//! runtime (`Tensor::op()` is `pub(crate)`), and several candle-nn ops sever gradient flow
5//! silently, so the only way to answer "does this parameter receive a gradient" is to read the
6//! source.
7//!
8//! It reconstructs module and parameter structure, expression-level dtype and gradient dataflow,
9//! deterministic CI baselines, and a standalone interactive report.
10//!
11//! Compile-time static analysis is always available. Enable the `runtime` feature for
12//! train/inference phase graphs, runtime trace import, gradient audit, and profiling.
13
14pub mod analysis_cache;
15pub mod baseline;
16pub mod cargo_context;
17pub mod cli;
18pub mod contracts;
19pub mod dataflow;
20pub mod diagnostics;
21pub mod discover;
22pub mod extract;
23pub mod ir;
24pub mod known;
25pub mod load;
26pub mod model_baseline;
27pub mod model_ir;
28pub mod op_semantics;
29pub mod phase;
30#[cfg(feature = "runtime")]
31pub mod profile;
32pub mod query;
33pub mod report;
34#[cfg(feature = "runtime")]
35pub mod runtime;
36pub mod verify;
37pub mod viewer;
38
39pub use phase::ExecutionPhase;
40pub use ir::Structure;