klyn.math.NDArray.reshape
method
public reshape(notnull shape as Tuple) as NDArray<T>
Description

Reshapes the NDArray using a tuple shape.

a = NDArray<Int>([1, 2, 3, 4])
b = a.reshape((2, 2))
Parameters
ParameterDescription
shapeFixed-size tuple of dimensions.
Returns

A new NDArray with same data order.

Throws
  • NullException if shape is null at runtime; statically null arguments are rejected with TypeError.