1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! Typed tensor-graph IR: types, shape inference, builder and verifier, plus
//! the exact optimization passes (constant folding, common-subexpression
//! elimination, dead-code elimination).
//!
//! Part of [oxfuse](https://github.com/sara-star-quant/oxfuse), a small tensor
//! graph compiler whose CPU backends return identical bits. Start here to
//! build and check a graph; `oxfuse-runtime` runs it.
//!
//! ```
//! use oxfuse_core::{GraphBuilder, Limits, Op};
//!
//! # fn main() -> Result<(), oxfuse_core::Error> {
//! let mut b = GraphBuilder::new(Limits::default());
//! let x = b.input("x", vec![2, 3])?;
//! let w = b.constant("w", vec![3, 2], vec![0.5, -1.0, 1.5, 2.0, -0.5, 1.0])?;
//! let m = b.node("m", Op::MatMul, &[x, w])?;
//! let y = b.node("y", Op::Relu, &[m])?;
//! // `finish` runs the verifier: shapes and types are re-checked here.
//! let graph = b.finish(&[y])?;
//! assert_eq!(graph.outputs().len(), 1);
//! # Ok(())
//! # }
//! ```
//!
//! Not for: general ML work. The op set is seven float32 ops.
pub use GraphBuilder;
pub use Error;
pub use ;
pub use Limits;
pub use Op;
pub use ;