Struct tract_hir::prelude::SimpleState [−][src]
Fields
states: Vec<Option<Box<dyn OpState + 'static, Global>>, Global>
session_state: SessionState
values: Vec<Option<SmallVec<[Arc<Tensor>; 4]>>, Global>
Implementations
impl<F, O, M, P> SimpleState<F, O, M, P> where
M: Borrow<Graph<F, O>> + Hash,
P: Borrow<SimplePlan<F, O, M>> + Clone,
O: Debug + Display + AsRef<dyn Op + 'static> + AsMut<dyn Op + 'static> + Clone + 'static + Hash,
F: Fact + Hash + Clone + 'static,
[src]
M: Borrow<Graph<F, O>> + Hash,
P: Borrow<SimplePlan<F, O, M>> + Clone,
O: Debug + Display + AsRef<dyn Op + 'static> + AsMut<dyn Op + 'static> + Clone + 'static + Hash,
F: Fact + Hash + Clone + 'static,
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]
&mut self,
inputs: SmallVec<[Tensor; 4]>
) -> Result<SmallVec<[Arc<Tensor>; 4]>, Error>
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<'a, 'c, 'b> 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]
&mut self,
inputs: SmallVec<[Tensor; 4]>,
eval: Eval
) -> Result<SmallVec<[Arc<Tensor>; 4]>, Error> where
E: Into<Error> + Send + Sync + 'static,
Eval: for<'a, 'c, 'b> FnMut(&'a mut SessionState, Option<&'b mut (dyn OpState + 'static)>, &'c Node<F, O>, SmallVec<[Arc<Tensor>; 4]>) -> Result<SmallVec<[Arc<Tensor>; 4]>, E>,
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]
&mut self,
id: usize,
values: SmallVec<[Tensor; 4]>
) -> Result<(), Error>
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]
&self,
node: usize
) -> Result<SmallVec<[Arc<Tensor>; 4]>, Error>
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]
&mut self,
node: usize,
inputs: SmallVec<[Arc<Tensor>; 4]>
) -> Result<(), Error>
pub fn compute_recursively(
&mut self,
node: usize
) -> Result<&[Arc<Tensor>], Error>
[src]
&mut self,
node: usize
) -> Result<&[Arc<Tensor>], Error>
pub fn take_by_name(
&mut self,
name: &str
) -> Result<SmallVec<[Tensor; 4]>, Error>
[src]
&mut self,
name: &str
) -> Result<SmallVec<[Tensor; 4]>, Error>
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
M: Clone + Borrow<Graph<F, O>> + Hash,
P: Clone + Borrow<SimplePlan<F, O, M>>,
O: Clone + Debug + Display + AsRef<dyn Op + 'static> + AsMut<dyn Op + 'static> + 'static + Hash,
F: Clone + Fact + Hash + 'static,
[src]
M: Clone + Borrow<Graph<F, O>> + Hash,
P: Clone + Borrow<SimplePlan<F, O, M>>,
O: Clone + Debug + Display + AsRef<dyn Op + 'static> + AsMut<dyn Op + 'static> + 'static + Hash,
F: Clone + Fact + Hash + 'static,
pub fn clone(&self) -> SimpleState<F, O, M, P>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<F, O, M, P> Debug for SimpleState<F, O, M, P> where
M: Debug + Borrow<Graph<F, O>> + Hash,
P: Debug + Borrow<SimplePlan<F, O, M>>,
O: Debug + Display + AsRef<dyn Op + 'static> + AsMut<dyn Op + 'static> + Clone + 'static + Hash,
F: Debug + Fact + Hash + Clone + 'static,
[src]
M: Debug + Borrow<Graph<F, O>> + Hash,
P: Debug + Borrow<SimplePlan<F, O, M>>,
O: Debug + Display + AsRef<dyn Op + 'static> + AsMut<dyn Op + 'static> + Clone + 'static + Hash,
F: Debug + Fact + Hash + Clone + 'static,
Auto Trait Implementations
impl<F, O, M, P> !RefUnwindSafe for SimpleState<F, O, M, P>
impl<F, O, M, P> Send for SimpleState<F, O, M, P> where
M: Send,
O: Send,
P: Send,
M: Send,
O: Send,
P: Send,
impl<F, O, M, P> !Sync for SimpleState<F, O, M, P>
impl<F, O, M, P> Unpin for SimpleState<F, O, M, P> where
F: Unpin,
M: Unpin,
O: Unpin,
P: Unpin,
F: Unpin,
M: Unpin,
O: Unpin,
P: Unpin,
impl<F, O, M, P> !UnwindSafe for SimpleState<F, O, M, P>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow(&self) -> &TⓘNotable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut TⓘNotable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<T> Downcast for T where
T: Any,
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<R, Global>
impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
Notable traits for Box<R, Global>
impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Any + Send + Sync,
T: Any + Send + Sync,
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
pub fn __clone_box(&self, Private) -> *mut ()
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,