[−][src]Function autograd::ops::add
pub fn add<T: Float, A: AsRef<Tensor<T>>, B: AsRef<Tensor<T>>>(
a: A,
b: B
) -> Tensor<T>
Addition.
+
operator can be used instead.
extern crate ndarray; extern crate autograd as ag; let ref a = ag::ones(&[2]); let ref b = ag::ones(&[2]); let ref z: ag::Tensor<f32> = a + b; assert_eq!(z.eval(&[]), Some(ndarray::arr1(&[2., 2.]).into_dyn()));