logo

Function neuronika::range[][src]

pub fn range(start: f32, end: f32, step: f32) -> Var<Input<Ix1>>
Expand description

Creates a one-dimensional variable with elements from start to end spaced by step.

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::range(0., 5., 1.);
assert!(*tensor.data() == arr1(&[0., 1., 2., 3., 4.]))