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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//! # `onnx-std`
//!
//! A pure-Rust ONNX **standard library** — model I/O, textual format, and an
//! extensible validator — built on the shared runtime IR. This is the first
//! wave of the design captured in `docs/ONNX_RS.md`.
//!
//! ## Relationship to the rest of the workspace
//!
//! `onnx-std` does **not** define its own IR. Per ONNX_RS §4.1 ("Shared Crate"),
//! the `Graph` / `Node` / `Value` / `Tensor` / `WeightRef` types are reused
//! verbatim from [`onnx_runtime_ir`], and the protobuf parse/encode stack is
//! reused from [`onnx_runtime_loader`]. `onnx-std` is the *standard-library*
//! layer on top: ergonomic model I/O, a human-readable text format, and a
//! checker — the concerns the design assigns to the ONNX library rather than the
//! inference runtime.
//!
//! ```text
//! onnx-std ──(standard lib: load/save/print/check)
//! │
//! └─ depends on ─▶ onnx-runtime-ir (shared Graph/Node/Value IR)
//! └─ depends on ─▶ onnx-runtime-loader (protobuf serde + weight mmap)
//! ```
//!
//! ## What this wave covers
//!
//! | ONNX_RS § | Feature | Status |
//! |------------|---------|--------|
//! | §3.4 / §4 | [`load_model`] / [`save_model`] round-trip | ✅ |
//! | §5 | [`Model::to_text`] / [`Model::from_text`] | ✅ |
//! | §7 | [`schema`] op schemas and opset-aware registry | ✅ |
//! | §8 | [`check::OnnxChecker`] extensible validator | ✅ (schema-aware) |
//! | §9 | [`shape::infer_shapes`] symbolic shape inference | ✅ |
//! | §10 | [`version::VersionConverter`] opset conversion | ✅ |
//! | §6.2 | [`textproto`] protobuf TextFormat I/O | ✅ |
//!
//! JSON and protobuf TextFormat are descriptor-driven from the exact vendored
//! ONNX proto, so every bound message, field, oneof, and enum is covered. The
//! readable text DSL appends a protobuf-TextFormat extension containing only
//! fields outside the graph syntax. The parsed DSL is authoritative for every
//! field it represents, while the explicit extension preserves the remainder.
//!
//! Deferred to later waves (see `// FOLLOW-UP` markers): the complete operator
//! catalog, remaining function/IR-gate checker rules, custom-op registration
//! (§11), and Python bindings (§12). Training semantics are out of scope.
//!
//! ## Example
//!
//! ```no_run
//! let model = onnx_std::load_model("model.onnx")?;
//! println!("{}", model.to_text());
//! let report = model.validate();
//! assert!(report.is_valid());
//! onnx_std::save_model(&model, "roundtrip.onnx")?;
//! # Ok::<(), onnx_std::Error>(())
//! ```
pub use ;
pub use ;
// Re-export the shared IR and the metadata/weight types so downstream users can
// build and inspect models without depending on the runtime crates directly
// (ONNX_RS §4.1: the IR is shared, not re-defined here).
pub use onnx_runtime_ir as ir;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;