Struct autograd::Feed [−][src]
pub struct Feed<'feed, T: Float> { /* fields omitted */ }
Expand description
Links a placeholder tensor and its value at run-time.
Use Tensor::given
to instanciate, and
ensure that this is passed to ag::Eval
, ag::eval
or Tensor::eval
.
use ndarray::array;
use autograd as ag;
ag::with(|g| {
let x = g.placeholder(&[2]);
// Fills the placeholder with an ArrayView, then eval.
let value = array![1., 1.];
let feed: ag::Feed<_> = x.given(value.view());
x.eval(&[feed]);
});