Function neuronika::linspace [−][src]
Expand description
Creates a one-dimensional variable with n evenly spaced elements.
The elements range from start
to end
(exclusive).
Panics
If the length is greater than isize::MAX
.
Examples
use neuronika;
use ndarray::arr1;
let tensor = neuronika::linspace(0., 1., 5);
assert!(*tensor.data() == arr1(&[0.0, 0.25, 0.5, 0.75, 1.0]))