iterate - return an array of sequential integers starting from zero
n->iterate()
shp.iterate()
The iterate() method returns an array of the
specified shape where each element is equal to its flattened
row-major index.
If called on a scalar integer n, it returns a 1D vector of length n containing values from 0 to n-1.
If called on a vector shp, it returns an array with the shape specified by the vector, where each element is its row-major flattened index.
An array of the specified shape containing sequential integers starting from 0.
TypeCheck if the input is not an integer or a
vector of integers.
5->iterate()
0 1 2 3 4
[2, 3].iterate()
0 1 2
3 4 5