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

Reshapes the NDArray to the specified shape.

Parameters
ParameterDescription
shapeShape dimensions.
Returns

A new reshaped NDArray.

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