[−][src]Function autograd::ops::normalize
pub fn normalize<AL: ArrayLike<T>, T: Float, A: AsRef<Tensor<T>>>(
x: A,
axes: &AL
) -> Tensor<T>
Normalizes the input tensor with its mean and variance along specified axis.
extern crate ndarray; extern crate autograd as ag; let ref x: ag::Tensor<f32> = ag::standard_normal(&[3, 4]); let ref y1 = ag::normalize(x, &[0]); let ref y2 = ag::normalize(x, &[0]); let evaluated = ag::eval(&[y1, y2], &[]); let e0 = &evaluated[0]; let e1 = &evaluated[1]; assert_eq!(e0.as_ref().unwrap().shape(), &[3, 4]); assert_eq!(e1.as_ref().unwrap().shape(), &[3, 4]);