[−][src]Function autograd::eval
pub fn eval<'a, 'b: 'a, 'c: 'a, V, U, T: Float + 'c + 'b>(
tensors: &[V],
feeds: U
) -> Vec<Option<NdArray<T>>> where
V: AsRef<Tensor<T>>,
U: IntoIterator<Item = &'a (&'b Tensor<T>, &'c Array<T, IxDyn>)>,
Evaluates given symbolic tensors.
Each return value can be None
;
for example, evaluation of gradient_descent_ops::*
would result in None
.
NOTE: All the runtime errors are not reported by return values, but by "panic" for convenience.
extern crate ndarray; extern crate autograd as ag; let ref a = ag::zeros(&[2]); let ref b = ag::ones(&[2]); // eval two tensors at once. let evaluated = ag::eval(&[a, b], &[]); assert_eq!(evaluated[0], Some(ndarray::arr1(&[0., 0.]).into_dyn())); assert_eq!(evaluated[1], Some(ndarray::arr1(&[1., 1.]).into_dyn()));