Struct autograd::Eval[][src]

pub struct Eval<'view, 'feed, 'graph, F: Float> { /* fields omitted */ }
Expand description

Helper structure for batched evaluation.

Eval structure can buffer evaluation targets with useful push and extend functions and runs batched evaluation. Use this in case Tensor::eval or Graph::eval doesn’t help.

use autograd as ag;
use ndarray;

ag::with(|g| {
   let a = g.placeholder(&[]);
   let x = a + a;
   let y = a * a;
   let z = a / a;

   ag::Eval::new(g)
       .push(&x)
       .extend(&[y, z])
       .feed(&[a.given(ndarray::arr0(2.).view())])
       .run();  // Do eval
   });

Implementations

Instantiates a new evaluation session.

Appends a tensor to the back of the evaluation targets.

feeds is a sequence of (placeholder-tensor, its value)

Extends the evaluation targets with xs.

Evaluates the buffered tensors.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.