[−][src]Function autograd::ops::reshape
pub fn reshape<AL: ArrayLike<T>, T: Float, A: AsRef<Tensor<T>>>(
x: A,
shape: &AL
) -> Tensor<T>
Reshapes input tensor.
Only one element in shape
can be -1
.
extern crate ndarray; extern crate autograd as ag; let ref x: ag::Tensor<f32> = ag::zeros(&[3, 2, 2]); let ref y = ag::reshape(&x, &[3, -1]); assert_eq!(y.eval(&[]), Some(ag::ndarray_ext::zeros::<f32>(&[3, 4])));