Function autograd::ops::floor [] [src]

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

Returns the largest integer less 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::floor(a);
assert_eq!(
    b.eval(&[]),
    Ok(ndarray::arr1(&[-2., -2., -1.,  0.,  1.,  1.,  2.]).into_dyn())
);