[][src]Struct autograd::Eval

pub struct Eval<'tsr, T: 'tsr + Float> { /* fields omitted */ }

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]

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]

Evaluates the buffered tensors.

feeds is a stream of (placeholder tensor, its value)

Auto Trait Implementations

impl<'tsr, T> !Send for Eval<'tsr, T>

impl<'tsr, T> !Sync for Eval<'tsr, T>

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

impl<T, U> TryInto 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> Any for T where
    T: 'static + ?Sized
[src]