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
//! Tensors, execution plans and the CPU backends: a plain reference backend
//! and a fast backend that returns exactly the same bits (the `parallel`
//! feature adds threads and still does not change a bit).
//!
//! Part of [oxfuse](https://github.com/sara-star-quant/oxfuse). Build a graph
//! with `oxfuse-core`, then compile and run it:
//!
//! ```
//! use oxfuse_core::{GraphBuilder, Limits, Op};
//! use oxfuse_runtime::{Backend, CpuBackend, Tensor};
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let mut b = GraphBuilder::new(Limits::default());
//! let x = b.input("x", vec![2])?;
//! let y = b.node("y", Op::Relu, &[x])?;
//! let graph = b.finish(&[y])?;
//!
//! let input = Tensor::new(vec![2], vec![-1.0, 2.0])?;
//! let out = CpuBackend.compile(&graph)?.run(&[input])?;
//! assert_eq!(out[0].data(), &[0.0, 2.0]);
//! # Ok(())
//! # }
//! ```
pub use ;
pub use CpuBackend;
pub use ReferenceEvaluator;
pub use sigmoid;
pub use ;
pub use ReferenceBackend;
pub use Tensor;