public static ones(notnull shape as ArrayList<Object>) as NDArray<T>
Creates a new NDArray with ones.
| Parameter | Description |
|---|---|
shape | Dimensions as objects converted to integers. |
A new NDArray filled with 1.
dims = [2, 2] a = NDArray<Int>.ones(dims) print(a)