Function autograd::ops::maximum [] [src]

pub fn maximum(a: &Tensor, b: &Tensor) -> Tensor

Returns the max of x and y (i.e. x > y ? x : y) element-wise.

extern crate ndarray;
extern crate autograd as ag;

let ref a = ag::constant(ndarray::arr1(&[1., 2., 3.]));
let ref b = ag::constant(ndarray::arr1(&[3., 2., 1.]));
let ref c = ag::maximum(a, b);
assert_eq!(c.eval(&[]), Ok(ndarray::arr1(&[3., 2., 3.]).into_dyn()));