Function autograd::ops::ceil [] [src]

pub fn ceil(a: &Tensor) -> Tensor

Returns the smallest integer greater than or equal to a number, element-wise.

extern crate ndarray;
extern crate autograd as ag;

let ref a = ag::constant(ndarray::arr1(&[-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0]));
let ref b = ag::ceil(a);
assert_eq!(
    b.eval(&[]),
    Ok(ndarray::arr1(&[-1., -1., -0.,  1.,  2.,  2.,  2.]).into_dyn())
);