Struct orkhon::prelude::internal::SimpleState[][src]

pub struct SimpleState<F, O, M, P> where
    P: Borrow<SimplePlan<F, O, M>>,
    F: Fact + Hash + Clone + 'static,
    O: Debug + Display + AsRef<dyn Op + 'static> + AsMut<dyn Op + 'static> + Clone + 'static + Hash,
    M: Borrow<Graph<F, O>> + Hash
{ pub states: Vec<Option<Box<dyn OpState + 'static, Global>>, Global>, pub session_state: SessionState, pub values: Vec<Option<SmallVec<[Arc<Tensor>; 4]>>, Global>, // some fields omitted }

Fields

states: Vec<Option<Box<dyn OpState + 'static, Global>>, Global>session_state: SessionStatevalues: Vec<Option<SmallVec<[Arc<Tensor>; 4]>>, Global>

Implementations

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

pub fn new(plan: P) -> Result<SimpleState<F, O, M, P>, Error>[src]

pub fn reset_wires(&mut self) -> Result<(), Error>[src]

Reset wires state.

pub fn reset_op_states(&mut self) -> Result<(), Error>[src]

Reset wires state.

pub fn run(
    &mut self,
    inputs: SmallVec<[Tensor; 4]>
) -> Result<SmallVec<[Arc<Tensor>; 4]>, Error>
[src]

pub fn run_plan_with_eval<Eval, E>(
    &mut self,
    inputs: SmallVec<[Tensor; 4]>,
    eval: Eval
) -> Result<SmallVec<[Arc<Tensor>; 4]>, Error> where
    E: Into<Error> + Send + Sync + 'static,
    Eval: for<'b, 'c, 'a> FnMut(&'a mut SessionState, Option<&'b mut (dyn OpState + 'static)>, &'c Node<F, O>, SmallVec<[Arc<Tensor>; 4]>) -> Result<SmallVec<[Arc<Tensor>; 4]>, E>, 
[src]

pub fn set_inputs(&mut self, inputs: SmallVec<[Tensor; 4]>) -> Result<(), Error>[src]

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

pub fn take_outputs(&mut self) -> Result<Vec<Arc<Tensor>, Global>, Error>[src]

pub fn set_values(
    &mut self,
    id: usize,
    values: SmallVec<[Tensor; 4]>
) -> Result<(), Error>
[src]

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

pub fn prepare_inputs(
    &self,
    node: usize
) -> Result<SmallVec<[Arc<Tensor>; 4]>, Error>
[src]

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

pub fn compute_one_with_inputs(
    &mut self,
    node: usize,
    inputs: SmallVec<[Arc<Tensor>; 4]>
) -> Result<(), Error>
[src]

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

pub fn take_by_name(
    &mut self,
    name: &str
) -> Result<SmallVec<[Tensor; 4]>, Error>
[src]

pub fn take(&mut self, id: usize) -> Result<SmallVec<[Tensor; 4]>, Error>[src]

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

pub fn model(&self) -> &Graph<F, O>[src]

Trait Implementations

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

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

Auto Trait Implementations

impl<F, O, M, P> !RefUnwindSafe for SimpleState<F, O, M, P>[src]

impl<F, O, M, P> Send for SimpleState<F, O, M, P> where
    M: Send,
    O: Send,
    P: Send
[src]

impl<F, O, M, P> !Sync for SimpleState<F, O, M, P>[src]

impl<F, O, M, P> Unpin for SimpleState<F, O, M, P> where
    F: Unpin,
    M: Unpin,
    O: Unpin,
    P: Unpin
[src]

impl<F, O, M, P> !UnwindSafe for SimpleState<F, O, M, P>[src]

Blanket Implementations

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

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

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

impl<T> Downcast for T where
    T: Any

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

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

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

impl<T, U> Into<U> for T where
    U: From<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.