trait AttributeTrait (View source)

Attribute methods for NdArray

Properties

protected array $data

Methods

void
__set(string $name, mixed $value)

Attribute setter

int|array|NdArray
__get(string $name)

Generic getter

int
getSize()

Get the total number of elements of the array

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

No description

Details

final void __set(string $name, mixed $value)

Attribute setter

Parameters

string $name
mixed $value

Return Value

void

final int|array|NdArray __get(string $name)

Generic getter

Parameters

string $name

Return Value

int|array|NdArray

Exceptions

InvalidAttributeException

final protected int getSize()

Get the total number of elements of the array

Return Value

int

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

Parameters

array|int|float $data
array $shape

Return Value

array