[−]Struct tract_onnx::prelude::SimpleState
Fields
states: Vec<Option<Box<dyn OpState + 'static>>>
session_state: SessionState
values: Vec<Option<SmallVec<[Arc<Tensor>; 4]>>>
Implementations
impl<F, O, M, P> SimpleState<F, O, M, P> where
F: Fact + Hash + Clone + 'static,
M: Borrow<Graph<F, O>> + Hash,
O: Debug + Display + AsRef<dyn Op + 'static> + AsMut<dyn Op + 'static> + Clone + 'static + Hash,
P: Borrow<SimplePlan<F, O, M>> + Clone,
F: Fact + Hash + Clone + 'static,
M: Borrow<Graph<F, O>> + Hash,
O: Debug + Display + AsRef<dyn Op + 'static> + AsMut<dyn Op + 'static> + Clone + 'static + Hash,
P: Borrow<SimplePlan<F, O, M>> + Clone,
pub fn new(plan: P) -> Result<SimpleState<F, O, M, P>, TractError>
pub fn reset_wires(&mut self) -> Result<(), TractError>
Reset wires state.
pub fn reset_op_states(&mut self) -> Result<(), TractError>
Reset wires state.
pub fn run(
&mut self,
inputs: SmallVec<[Tensor; 4]>
) -> Result<SmallVec<[Arc<Tensor>; 4]>, TractError>
&mut self,
inputs: SmallVec<[Tensor; 4]>
) -> Result<SmallVec<[Arc<Tensor>; 4]>, TractError>
pub fn run_plan_with_eval<Eval>(
&mut self,
inputs: SmallVec<[Tensor; 4]>,
eval: Eval
) -> Result<SmallVec<[Arc<Tensor>; 4]>, TractError> where
Eval: for<'b, 'c, 'a> FnMut(&'a mut SessionState, Option<&'b mut (dyn OpState + 'static)>, &'c BaseNode<F, O>, SmallVec<[Arc<Tensor>; 4]>) -> Result<SmallVec<[Arc<Tensor>; 4]>, TractError>,
&mut self,
inputs: SmallVec<[Tensor; 4]>,
eval: Eval
) -> Result<SmallVec<[Arc<Tensor>; 4]>, TractError> where
Eval: for<'b, 'c, 'a> FnMut(&'a mut SessionState, Option<&'b mut (dyn OpState + 'static)>, &'c BaseNode<F, O>, SmallVec<[Arc<Tensor>; 4]>) -> Result<SmallVec<[Arc<Tensor>; 4]>, TractError>,
pub fn set_inputs(
&mut self,
inputs: SmallVec<[Tensor; 4]>
) -> Result<(), TractError>
&mut self,
inputs: SmallVec<[Tensor; 4]>
) -> Result<(), TractError>
pub fn set_input(&mut self, input: usize, t: Tensor) -> Result<(), TractError>
pub fn take_outputs(&mut self) -> Result<Vec<Arc<Tensor>>, TractError>
pub fn set_values(
&mut self,
id: usize,
values: SmallVec<[Tensor; 4]>
) -> Result<(), TractError>
&mut self,
id: usize,
values: SmallVec<[Tensor; 4]>
) -> Result<(), TractError>
pub fn set_value(&mut self, id: usize, value: Tensor) -> Result<(), TractError>
pub fn prepare_inputs(
&self,
node: usize
) -> Result<SmallVec<[Arc<Tensor>; 4]>, TractError>
&self,
node: usize
) -> Result<SmallVec<[Arc<Tensor>; 4]>, TractError>
pub fn compute_one(&mut self, node: usize) -> Result<(), TractError>
pub fn compute_one_with_inputs(
&mut self,
node: usize,
inputs: SmallVec<[Arc<Tensor>; 4]>
) -> Result<(), TractError>
&mut self,
node: usize,
inputs: SmallVec<[Arc<Tensor>; 4]>
) -> Result<(), TractError>
pub fn compute_recursively(
&mut self,
node: usize
) -> Result<&[Arc<Tensor>], TractError>
&mut self,
node: usize
) -> Result<&[Arc<Tensor>], TractError>
pub fn take_by_name(
&mut self,
name: &str
) -> Result<SmallVec<[Tensor; 4]>, TractError>
&mut self,
name: &str
) -> Result<SmallVec<[Tensor; 4]>, TractError>
pub fn take(&mut self, id: usize) -> Result<SmallVec<[Tensor; 4]>, TractError>
pub fn plan(&self) -> &SimplePlan<F, O, M>
pub fn model(&self) -> &Graph<F, O>
Trait Implementations
impl<F, O, M, P> Clone for SimpleState<F, O, M, P> where
F: Clone + Fact + Hash + 'static,
M: Clone + Borrow<Graph<F, O>> + Hash,
O: Clone + Debug + Display + AsRef<dyn Op + 'static> + AsMut<dyn Op + 'static> + 'static + Hash,
P: Clone + Borrow<SimplePlan<F, O, M>>,
F: Clone + Fact + Hash + 'static,
M: Clone + Borrow<Graph<F, O>> + Hash,
O: Clone + Debug + Display + AsRef<dyn Op + 'static> + AsMut<dyn Op + 'static> + 'static + Hash,
P: Clone + Borrow<SimplePlan<F, O, M>>,
fn clone(&self) -> SimpleState<F, O, M, P>
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<F, O, M, P> Debug for SimpleState<F, O, M, P> where
F: Debug + Fact + Hash + Clone + 'static,
M: Debug + Borrow<Graph<F, O>> + Hash,
O: Debug + Display + AsRef<dyn Op + 'static> + AsMut<dyn Op + 'static> + Clone + 'static + Hash,
P: Debug + Borrow<SimplePlan<F, O, M>>,
F: Debug + Fact + Hash + Clone + 'static,
M: Debug + Borrow<Graph<F, O>> + Hash,
O: Debug + Display + AsRef<dyn Op + 'static> + AsMut<dyn Op + 'static> + Clone + 'static + Hash,
P: Debug + Borrow<SimplePlan<F, O, M>>,
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,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut Tⓘ
[src]
impl<T> Downcast for T where
T: Any,
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>ⓘ
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
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.
fn to_owned(&self) -> T
[src]
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.
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>,