trait ShapeTrait (View source)

Shape methods for NdArray

Methods

ravel()

Flattens data array

resize()

Resize array

reshape()

Reshapes data

array
getShape(int|float|array $data, array $shape)

Gets the dimensions of the array

Details

final NdArray ravel()

Flattens data array

Return Value

NdArray

final NdArray resize()

Resize array

Return Value

NdArray

final NdArray reshape()

Reshapes data

Return Value

NdArray

Exceptions

InvalidArgumentException if shape parameter has a different size

final protected array getShape(int|float|array $data, array $shape)

Gets the dimensions of the array

Parameters

int|float|array $data Axis
array $shape

Return Value

array