klyn.math.NDArray.ones
method
public static ones(shape as Tuple) as NDArray<T>:
Description
Creates a new NDArray with ones from a tuple shape.
a = NDArray<Int>.ones((2, 2))
Parameters
  • shape Fixed-size tuple of dimensions.
Returns
A new NDArray filled with 1.