logo

Function neuronika::rand[][src]

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

Creates a variable with values sampled from a uniform distribution on the interval [0,1).

The shape is of type ndarray::ShapeBuilder.

Examples

use neuronika;
let t = neuronika::rand([4, 5, 6]);

assert_eq!(t.data().shape(), &[4, 5, 6]);