use crate::Tensor;
use oxfuse_core::{Error, Graph};
pub trait Backend {
fn compile(&self, graph: &Graph) -> Result<Box<dyn Executable>, Error>;
}
pub trait Executable {
fn run(&self, inputs: &[Tensor]) -> Result<Vec<Tensor>, Error>;
fn run_many(&self, batches: &[Vec<Tensor>]) -> Result<Vec<Vec<Tensor>>, Error> {
batches.iter().map(|inputs| self.run(inputs)).collect()
}
}