pub trait Executable {
// Required method
fn run(&self, inputs: &[Tensor]) -> Result<Vec<Tensor>, Error>;
// Provided method
fn run_many(
&self,
batches: &[Vec<Tensor>],
) -> Result<Vec<Vec<Tensor>>, Error> { ... }
}Required Methods§
Provided Methods§
Sourcefn run_many(&self, batches: &[Vec<Tensor>]) -> Result<Vec<Vec<Tensor>>, Error>
fn run_many(&self, batches: &[Vec<Tensor>]) -> Result<Vec<Vec<Tensor>>, Error>
Runs the graph once per element of batches and returns the results in
the same order; every result equals what run returns for that element.
The default runs them one after another. The GPU backend overrides it to
submit the whole batch at once and wait once, which hides the per-run
wait; its memory use grows with the batch.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".