klyn.math.NDArray.ones
method
public static ones(notnull shape as IList<UInt>) as NDArray<T>
Description

Creates a new NDArray with ones.

Parameters
ParameterDescription
shapeThe shape of the array.
Returns

A new NDArray filled with 1.

Throws
  • NullException if shape is null at runtime; statically null arguments are rejected with TypeError.
Example
a = NDArray<Int>.ones([2, 2])