klyn.math.NDArray.full
method
public static full(notnull shape as ArrayList<Object>, value as T) as NDArray<T>
Description

Creates a new NDArray filled with a given value.

Parameters
ParameterDescription
shapeDimensions as objects converted to integers.
valueValue written in every cell.
Returns

A new filled NDArray.

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