Function autograd::ops::expand_dims [] [src]

pub fn expand_dims<T: ArrayLike>(x: &Tensor, axes: &T) -> Tensor

Expands specified dims.

Each axis can be negative.

extern crate autograd as ag;

let ref a = ag::zeros(&[3]);
let ref b = ag::expand_dims(a, &[0, 2]);

assert_eq!(b.eval(&[]).unwrap().shape(), &[1, 3, 1]);