[][src]Struct tract_core::plan::SimpleState

pub struct SimpleState<TI, O, M, P> where
    TI: Fact + Clone + 'static,
    O: Debug + Display + AsRef<dyn Op> + AsMut<dyn Op> + Clone + 'static,
    M: Borrow<ModelImpl<TI, O>>,
    P: Borrow<SimplePlan<TI, O, M>>, 
{ pub states: Vec<Option<Box<dyn OpState>>>, pub session_state: SessionState, pub values: Vec<Option<TVec<Arc<Tensor>>>>, // some fields omitted }

Fields

states: Vec<Option<Box<dyn OpState>>>session_state: SessionStatevalues: Vec<Option<TVec<Arc<Tensor>>>>

Methods

impl<TI, O, M, P> SimpleState<TI, O, M, P> where
    TI: Fact + Clone + 'static,
    O: Debug + Display + AsRef<dyn Op> + AsMut<dyn Op> + Clone + 'static,
    M: Borrow<ModelImpl<TI, O>>,
    P: Borrow<SimplePlan<TI, O, M>> + Clone
[src]

pub fn new(plan: P) -> TractResult<SimpleState<TI, O, M, P>>[src]

pub fn new_multiplan(plans: Vec<P>) -> TractResult<SimpleState<TI, O, M, P>>[src]

pub fn reset_wires(&mut self) -> TractResult<()>[src]

Reset wires state.

pub fn reset_op_states(&mut self) -> TractResult<()>[src]

Reset wires state.

pub fn run(&mut self, inputs: TVec<Tensor>) -> TractResult<TVec<Arc<Tensor>>>[src]

pub fn run_plan(
    &mut self,
    inputs: TVec<Tensor>,
    plan: usize
) -> TractResult<TVec<Arc<Tensor>>>
[src]

pub fn set_inputs(&mut self, inputs: TVec<Tensor>) -> TractResult<()>[src]

pub fn set_input(&mut self, input: usize, t: Tensor) -> TractResult<()>[src]

pub fn take_outputs(&mut self) -> TractResult<Vec<Arc<Tensor>>>[src]

pub fn set_values(&mut self, id: usize, values: TVec<Tensor>) -> TractResult<()>[src]

pub fn set_value(&mut self, id: usize, value: Tensor) -> TractResult<()>[src]

pub fn compute_one(&mut self, node: usize) -> TractResult<()>[src]

pub fn compute_recursively(
    &mut self,
    node: usize
) -> TractResult<&[Arc<Tensor>]>
[src]

pub fn take_by_name(&mut self, name: &str) -> TractResult<TVec<Tensor>>[src]

pub fn take(&mut self, id: usize) -> TractResult<TVec<Tensor>>[src]

pub fn plan(&self) -> &SimplePlan<TI, O, M>[src]

pub fn model(&self) -> &ModelImpl<TI, O>[src]

Trait Implementations

impl<TI, O, M, P> Clone for SimpleState<TI, O, M, P> where
    TI: Fact + Clone + 'static,
    O: Debug + Display + AsRef<dyn Op> + AsMut<dyn Op> + Clone + 'static,
    M: Borrow<ModelImpl<TI, O>>,
    P: Borrow<SimplePlan<TI, O, M>> + Clone
[src]

impl<TI: Debug, O: Debug, M: Debug, P: Debug> Debug for SimpleState<TI, O, M, P> where
    TI: Fact + Clone + 'static,
    O: Debug + Display + AsRef<dyn Op> + AsMut<dyn Op> + Clone + 'static,
    M: Borrow<ModelImpl<TI, O>>,
    P: Borrow<SimplePlan<TI, O, M>>, 
[src]

Auto Trait Implementations

impl<TI, O, M, P> Send for SimpleState<TI, O, M, P> where
    M: Send,
    O: Send,
    P: Send

impl<TI, O, M, P> !Sync for SimpleState<TI, O, M, P>

impl<TI, O, M, P> Unpin for SimpleState<TI, O, M, P> where
    M: Unpin,
    O: Unpin,
    P: Unpin,
    TI: Unpin

impl<TI, O, M, P> !UnwindSafe for SimpleState<TI, O, M, P>

impl<TI, O, M, P> !RefUnwindSafe for SimpleState<TI, O, M, P>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Send + Sync + Any
[src]

impl<T> Clone for T where
    T: Clone
[src]