pub struct BatchExecutor<'program> { /* private fields */ }Expand description
Reusable buffers for running one program on batches of records.
Implementations§
Source§impl<'program> BatchExecutor<'program>
impl<'program> BatchExecutor<'program>
pub fn new(program: &'program TensorProgram) -> BatchExecutor<'program>
Sourcepub fn run(&mut self, sources: &[f32]) -> Vec<f32>
pub fn run(&mut self, sources: &[f32]) -> Vec<f32>
Evaluate the program on consecutive source tables, program.source_size
values each, and return the roots’ values, program.roots.len() per
record. Sources aren’t range-checked; see Circuit::validate_source_ranges.
Sourcepub fn run_parallel(
program: &TensorProgram,
sources: &[f32],
threads: Option<usize>,
) -> Vec<f32>
pub fn run_parallel( program: &TensorProgram, sources: &[f32], threads: Option<usize>, ) -> Vec<f32>
BatchExecutor::run split across threads threads (all available cores
when None), with the outputs in record order.
Auto Trait Implementations§
impl<'program> Freeze for BatchExecutor<'program>
impl<'program> RefUnwindSafe for BatchExecutor<'program>
impl<'program> Send for BatchExecutor<'program>
impl<'program> Sync for BatchExecutor<'program>
impl<'program> Unpin for BatchExecutor<'program>
impl<'program> UnsafeUnpin for BatchExecutor<'program>
impl<'program> UnwindSafe for BatchExecutor<'program>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more