Function autograd::ops::shape [] [src]

pub fn shape(x: &Tensor) -> Tensor

Returns the (symbolic) shape of input tensor

extern crate autograd as ag;

let ref x = ag::zeros(&[2, 3]);
let ref s = ag::shape(x);

assert_eq!(&[2., 3.], s.eval(&[]).unwrap().as_slice().unwrap());