[−][src]Struct autograd::Eval
Helper structure for batched evaluation.
Use this in case ag::eval
doesn't help.
extern crate autograd as ag; extern crate ndarray as nd; let ref a = ag::placeholder(&[]); let ref x = a + a; let ref y = a * a; let ref z = a / a; ag::Eval::new() .push(&y) .extend(&[y, z]) .run(&[(a, &nd::arr0(2.).into_dyn())]); // Do eval
Methods
impl<'tpl, 'tsr: 'tpl, 'arr: 'tpl, T: Float + 'tsr + 'arr> Eval<'tsr, T>
[src]
pub fn new() -> Self
[src]
Instantiates a new evaluation session.
pub fn push(&mut self, x: &'tsr Tensor<T>) -> &mut Self
[src]
Appends a tensor to the back of the evaluation targets.
pub fn extend<A>(&mut self, xs: &'tsr [A]) -> &mut Self where
A: AsRef<Tensor<T>>,
[src]
A: AsRef<Tensor<T>>,
Extends the evaluation targets with xs
.
pub fn run<F>(&self, feed: F) -> Vec<Option<NdArray<T>>> where
F: IntoIterator<Item = &'tpl (&'tsr Tensor<T>, &'arr Array<T, IxDyn>)>,
[src]
F: IntoIterator<Item = &'tpl (&'tsr Tensor<T>, &'arr Array<T, IxDyn>)>,
Evaluates the buffered tensors.
feeds
is a stream of (placeholder tensor, its value)
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,