Skip to main content

TensorExecutor

Struct TensorExecutor 

Source
pub struct TensorExecutor<'program> {
    pub packed_values: Vec<f32>,
    /* private fields */
}
Expand description

Reusable buffers for running one program many times.

Fields§

§packed_values: Vec<f32>

After a run, packed_values[k] is the value of program.wire_order[k].

Implementations§

Source§

impl<'program> TensorExecutor<'program>

Source

pub fn new(program: &'program TensorProgram) -> TensorExecutor<'program>

Source

pub fn run(&mut self, source: &[f32]) -> &[f32]

Evaluate the program and return the roots’ values. The source is not range-checked; use Circuit::validate_source_ranges for that.

Auto Trait Implementations§

§

impl<'program> Freeze for TensorExecutor<'program>

§

impl<'program> RefUnwindSafe for TensorExecutor<'program>

§

impl<'program> Send for TensorExecutor<'program>

§

impl<'program> Sync for TensorExecutor<'program>

§

impl<'program> Unpin for TensorExecutor<'program>

§

impl<'program> UnsafeUnpin for TensorExecutor<'program>

§

impl<'program> UnwindSafe for TensorExecutor<'program>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<E> StoreElem<usize> for E

Source§

fn store(items: &mut [E], index: usize, value: E)

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.