oxfuse_runtime/backend.rs
1//! The portable backend interface. Kept minimal on purpose: it assumes host
2//! tensors, so a device-memory backend would need to revise it.
3
4use crate::Tensor;
5use oxfuse_core::{Error, Graph};
6
7pub trait Backend {
8 fn compile(&self, graph: &Graph) -> Result<Box<dyn Executable>, Error>;
9}
10
11pub trait Executable {
12 /// `inputs` follow the graph's declared input order; the result follows
13 /// the graph's output order.
14 fn run(&self, inputs: &[Tensor]) -> Result<Vec<Tensor>, Error>;
15}