logo

Function neuronika::zeros[][src]

pub fn zeros<D: Dimension, Sh: ShapeBuilder<Dim = D>>(
    shape: Sh
) -> Var<Input<D>>
Expand description

Creates a variable with zeroed data.

The shape is of type ndarray::ShapeBuilder.

Examples

use neuronika;
let t1 = neuronika::zeros(1);
let t2 = neuronika::zeros((1, 5));
let t3 = neuronika::zeros([1, 2, 3]);

assert_eq!(t1.data().shape(), &[1]);
assert_eq!(t2.data().shape(), &[1, 5]);
assert_eq!(t3.data().shape(), &[1, 2, 3]);